1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_array.rb (test_pack): use utf-8.

* test/ruby/test_pack.rb (test_pack_U): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-10-29 09:40:38 +00:00
parent 34c5cea9b5
commit 3056933cc0
2 changed files with 4 additions and 4 deletions

View file

@ -51,9 +51,9 @@ class TestPack < Test::Unit::TestCase
assert_raise(RangeError) { [-0x40000000].pack("U") }
assert_raise(RangeError) { [-1].pack("U") }
assert_equal "\000", [0].pack("U")
assert_equal "\374\277\277\277\277\277", [0x3fffffff].pack("U")
assert_equal "\375\200\200\200\200\200", [0x40000000].pack("U")
assert_equal "\375\277\277\277\277\277", [0x7fffffff].pack("U")
assert_equal "\374\277\277\277\277\277".force_encoding(Encoding::UTF_8), [0x3fffffff].pack("U")
assert_equal "\375\200\200\200\200\200".force_encoding(Encoding::UTF_8), [0x40000000].pack("U")
assert_equal "\375\277\277\277\277\277".force_encoding(Encoding::UTF_8), [0x7fffffff].pack("U")
assert_raise(RangeError) { [0x80000000].pack("U") }
assert_raise(RangeError) { [0x100000000].pack("U") }
end