From 034365e0e665689c2338add223365344c329e3d4 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 29 Nov 2017 11:44:57 +0100 Subject: [PATCH] Add a unit test for the label escape issue fixed in #6018 --- pdns/test-dnsname_cc.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pdns/test-dnsname_cc.cc b/pdns/test-dnsname_cc.cc index 42c84018fe..ad4b6155b7 100644 --- a/pdns/test-dnsname_cc.cc +++ b/pdns/test-dnsname_cc.cc @@ -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"); -- 2.47.2