diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-22 18:06:38 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-22 18:06:38 +0000 |
| commit | 8bd9e199d7382f07f95a7d2ab987a63e49430c31 (patch) | |
| tree | 2b3b22e449e52864de182a86958153eeee333b2e /test/ruby | |
| parent | d88f45ca19befd413bc8302871deb9de0b8eed44 (diff) | |
| download | ruby-8bd9e199d7382f07f95a7d2ab987a63e49430c31.tar.gz ruby-8bd9e199d7382f07f95a7d2ab987a63e49430c31.tar.xz ruby-8bd9e199d7382f07f95a7d2ab987a63e49430c31.zip | |
* pack.c (num2i32): pack should not raise RangeError.
[ruby-dev:22654]
* pack.c (pack_pack): do not auto convert nil to zero.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_pack.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index a1ae01839..9939f9f07 100644 --- a/test/ruby/test_pack.rb +++ b/test/ruby/test_pack.rb @@ -27,6 +27,10 @@ class TestPack < Test::Unit::TestCase assert_equal "\377\377\377\376", [4294967294].pack('N') assert_equal "\377\377\377\377", [4294967295].pack('N') + assert_equal "\200\000\000\000", [2**31].pack('N') + assert_equal "\177\377\377\377", [-2**31-1].pack('N') + assert_equal "\377\377\377\377", [-1].pack('N') + assert_equal "\000\000\000\001\000\000\000\001", [1,1].pack('N*') assert_equal "\000\000\000\001\000\000\000\001\000\000\000\001", [1,1,1].pack('N*') end |
