]> granicus.if.org Git - pdns/commitdiff
Add a unit test for the label escape issue fixed in #6018
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 29 Nov 2017 10:44:57 +0000 (11:44 +0100)
committermind04 <mind04@monshouwer.org>
Mon, 8 Jan 2018 15:13:12 +0000 (16:13 +0100)
pdns/test-dnsname_cc.cc

index 42c84018fec6e905da035729f1a5a80ec03c8f32..ad4b6155b7bb7ddac9be5abb5ca3e78efa91bee0 100644 (file)
@@ -128,16 +128,18 @@ BOOST_AUTO_TEST_CASE(test_basic) {
 
   BOOST_CHECK_EQUAL(unset.toString(), "www.powerdns\\.com.com.");
 
+  DNSName rfc4343_2_1("~!.example.");
   DNSName rfc4343_2_2(R"(Donald\032E\.\032Eastlake\0323rd.example.)");
   DNSName example("example.");
+  BOOST_CHECK(rfc4343_2_1.isPartOf(example));
   BOOST_CHECK(rfc4343_2_2.isPartOf(example));
+  BOOST_CHECK_EQUAL(rfc4343_2_1.toString(), "~!.example.");
 
   auto labels=rfc4343_2_2.getRawLabels();
   BOOST_CHECK_EQUAL(*labels.begin(), "Donald E. Eastlake 3rd");
   BOOST_CHECK_EQUAL(*labels.rbegin(), "example");
   BOOST_CHECK_EQUAL(labels.size(), 2);
 
-
   DNSName build;
   build.appendRawLabel("Donald E. Eastlake 3rd");
   build.appendRawLabel("example");