Skip to content
Snippets Groups Projects
Commit 252795d2 authored by bluemonk's avatar bluemonk
Browse files

Add RUBY_VERSION conditional test for UTF-8 encoded strings in ruby >= 2.0

parent 10c9350c
Branches
No related tags found
No related merge requests found
......@@ -109,7 +109,11 @@ class IPv4Test < Test::Unit::TestCase
end
def test_method_data
assert_equal "\254\020\n\001", @ip.data
if RUBY_VERSION < "2.0"
assert_equal "\254\020\n\001", @ip.data
else
assert_equal "\xAC\x10\n\x01".b, @ip.data
end
end
def test_method_to_string
......
......@@ -180,7 +180,11 @@ class IPv6Test < Test::Unit::TestCase
end
def test_method_data
str = " \001\r\270\000\000\000\000\000\b\b\000 \fAz"
if RUBY_VERSION < "2.0"
str = " \001\r\270\000\000\000\000\000\b\b\000 \fAz"
else
str = " \x01\r\xB8\x00\x00\x00\x00\x00\b\b\x00 \fAz".b
end
assert_equal str, @ip.data
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment