[ruby/ipaddr] Remove warning by asserting its presence

$ rake test >/dev/null
	/tmp/test/test_ipaddr.rb:202: warning: IPAddr#ipv4_compat is obsolete

https://github.com/ruby/ipaddr/commit/31d62407c2
This commit is contained in:
Étienne Barrié 2025-09-30 17:35:32 +02:00 committed by git
parent 17252958c9
commit 3eda2493ef

View File

@ -199,7 +199,9 @@ class TC_IPAddr < Test::Unit::TestCase
assert_equal(128, b.prefix)
a = IPAddr.new("192.168.0.0/16")
b = a.ipv4_compat
assert_warning(/obsolete/) {
b = a.ipv4_compat
}
assert_equal("::192.168.0.0", b.to_s)
assert_equal(Socket::AF_INET6, b.family)
assert_equal(112, b.prefix)