diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_pack.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index 33694b9f38..6101a30219 100644 --- a/test/ruby/test_pack.rb +++ b/test/ruby/test_pack.rb @@ -179,11 +179,23 @@ class TestPack < Test::Unit::TestCase assert_equal("", ["10ef"].pack("h0")) assert_equal("\x01\x0e", ["10ef"].pack("h3")) assert_equal("\x01\xfe\x0", ["10ef"].pack("h5")) + assert_equal("\xff\x0f", ["fff"].pack("h3")) + assert_equal("\xff\x0f", ["fff"].pack("h4")) + assert_equal("\xff\x0f\0", ["fff"].pack("h5")) + assert_equal("\xff\x0f\0", ["fff"].pack("h6")) + assert_equal("\xff\x0f\0\0", ["fff"].pack("h7")) + assert_equal("\xff\x0f\0\0", ["fff"].pack("h8")) assert_equal("\x10\xef", ["10ef"].pack("H*")) assert_equal("", ["10ef"].pack("H0")) assert_equal("\x10\xe0", ["10ef"].pack("H3")) assert_equal("\x10\xef\x0", ["10ef"].pack("H5")) + assert_equal("\xff\xf0", ["fff"].pack("H3")) + assert_equal("\xff\xf0", ["fff"].pack("H4")) + assert_equal("\xff\xf0\0", ["fff"].pack("H5")) + assert_equal("\xff\xf0\0", ["fff"].pack("H6")) + assert_equal("\xff\xf0\0\0", ["fff"].pack("H7")) + assert_equal("\xff\xf0\0\0", ["fff"].pack("H8")) assert_equal(["10ef"], "\x01\xfe".unpack("h*")) assert_equal([""], "\x01\xfe".unpack("h0")) |