From 7e1e49cb7dd044bbe0cf3722e358d856643b7c65 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Tue, 13 Aug 2013 09:51:49 -0700 Subject: [PATCH] Add regression test for APL trailing zero bug --- tests/bugs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/bugs.py b/tests/bugs.py index dd18f317..79b30eb6 100644 --- a/tests/bugs.py +++ b/tests/bugs.py @@ -13,6 +13,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +import binascii import unittest import dns.rdata @@ -45,5 +46,11 @@ class BugsTestCase(unittest.TestCase): "1 0 100 ABCD SCBCQHKU35969L2A68P3AD59LHF30715") self.assertTrue(rdata.windows == []) + def test_APL_trailing_zero(self): + rd4 = dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.APL, + '!1:127.0.0.0/1') + out4 = rd4.to_digestable(dns.name.from_text("test")) + self.assertTrue(binascii.hexlify(out4).decode('ascii') == '000101817f') + if __name__ == '__main__': unittest.main() -- 2.47.3