diff options
Diffstat (limited to 'test/resolv/test_resource.rb')
-rw-r--r-- | test/resolv/test_resource.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/resolv/test_resource.rb b/test/resolv/test_resource.rb index b75cf67f31..b688155dc2 100644 --- a/test/resolv/test_resource.rb +++ b/test/resolv/test_resource.rb @@ -23,4 +23,12 @@ class TestResolvResource < Test::Unit::TestCase def test_coord Resolv::LOC::Coord.create('1 2 1.1 N') end + + def test_srv_no_compress + # Domain name in SRV RDATA should not be compressed + issue29 = 'https://github.com/ruby/resolv/issues/29' + m = Resolv::DNS::Message.new(0) + m.add_answer('example.com', 0, Resolv::DNS::Resource::IN::SRV.new(0, 0, 0, 'www.example.com')) + assert_equal "\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x07example\x03com\x00\x00\x21\x00\x01\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x03www\x07example\x03com\x00", m.encode, issue29 + end end |