From d0e617e8466e3fa0846a5c203ad6f3c00736b7de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Sat, 7 Mar 2020 17:09:50 +0100 Subject: [PATCH] powerdns_tests: add description to some asserts, fix indent of disabled code --- lib/dnsbox-base/src/records/powerdns_tests.rs | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/dnsbox-base/src/records/powerdns_tests.rs b/lib/dnsbox-base/src/records/powerdns_tests.rs index 5e0f0a4..eea65fd 100644 --- a/lib/dnsbox-base/src/records/powerdns_tests.rs +++ b/lib/dnsbox-base/src/records/powerdns_tests.rs @@ -90,9 +90,16 @@ fn check(q: Type, text_input: &'static str, canonic: Option<&'static str>, raw: let d_zone_text = d_zone.text().unwrap(); // make sure we actually know the type and the text representation // uses the known representation (and not the generic one) - assert_eq!(Some(d_zone_text.0.as_ref()), d_zone.rr_type().known_name()); + assert_eq!( + Some(d_zone_text.0.as_ref()), + d_zone.rr_type().known_name(), + "type uses generic representation" + ); // ... and the text representation matches the canonic format - assert_eq!(&d_zone_text.1, canonic); + assert_eq!( + &d_zone_text.1, canonic, + "canonic representation doesn't match" + ); // (pdns tests compares this to the input_text sometimes, because // they often (TXT, DNS names) use the master file representation // internally instead of normalizing it. This is bad for testing, @@ -285,11 +292,11 @@ fn test_TXT() { ); // autosplitting not supported /* - check(types::TXT, - "\"long record test 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222\"", - Some("\"long record test 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\" \"2222222222\""), - b"\xfflong record test 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\x0a2222222222", - ); + check(types::TXT, + "\"long record test 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222\"", + Some("\"long record test 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\" \"2222222222\""), + b"\xfflong record test 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\x0a2222222222", + ); */ check( types::TXT,