diff options
| author | John Bond <b4ldr@users.noreply.github.com> | 2023-11-22 11:35:22 +0100 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-11-22 10:35:36 +0000 |
| commit | 9e24d747ffbc1040d93ac53bff0c1ef0914419c8 (patch) | |
| tree | d778b42446ae304ec59bd5f65b545aca6f216d92 /test | |
| parent | 6391ae9ebc0b7a6668e57aa9f3c7b76ff83fab70 (diff) | |
[ruby/resolv] IPv6: update to_s method to be RFC5952 compliant
(https://github.com/ruby/resolv/pull/25)
* IPv6: update to_s method to be RFC5952 compliant
I noticed that the resolv library does not honour RFC 5952 Section 4.2.2.
in relation to textural representation of ipv6 addresses:
The symbol "::" MUST NOT be used to shorten just one 16-bit 0 field.
For example, the representation 2001:db8:0:1:1:1:1:1 is correct, but
2001:db8::1:1:1:1:1 is not correct.
Fixes https://github.com/ruby/resolv/pull/24
https://github.com/ruby/resolv/commit/5efcd6ed70
Co-authored-by: Sorah Fukumori <sora134@gmail.com>
Diffstat (limited to 'test')
| -rw-r--r-- | test/resolv/test_dns.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/resolv/test_dns.rb b/test/resolv/test_dns.rb index 9d243bbf50..d9db8408fd 100644 --- a/test/resolv/test_dns.rb +++ b/test/resolv/test_dns.rb @@ -374,7 +374,8 @@ class TestResolvDNS < Test::Unit::TestCase ["2001:db8::1", "2001:db8::0:1"], ["::", "0:0:0:0:0:0:0:0"], ["2001::", "2001::0"], - ["2001:db8::1:1:1:1:1", "2001:db8:0:1:1:1:1:1"], + ["2001:db8:0:1:1:1:1:1", "2001:db8:0:1:1:1:1:1"], # RFC 5952 Section 4.2.2. + ["2001:db8::1:1:1:1", "2001:db8:0:0:1:1:1:1"], ["1::1:0:0:0:1", "1:0:0:1:0:0:0:1"], ["1::1:0:0:1", "1:0:0:0:1:0:0:1"], ] |
