diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-26 05:05:37 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-26 05:05:37 +0000 |
commit | 1f18d5d4c7117912c323dd2daaf54649ecba6c1c (patch) | |
tree | 83e5145c28b8b2b1088d36857aa3a5af1cb02439 | |
parent | 9f498ac53d2613f2f418e680904fbc41c2a6ffbb (diff) | |
download | ruby-1f18d5d4c7117912c323dd2daaf54649ecba6c1c.tar.gz ruby-1f18d5d4c7117912c323dd2daaf54649ecba6c1c.tar.xz ruby-1f18d5d4c7117912c323dd2daaf54649ecba6c1c.zip |
* test/ruby/test_pack.rb: new test test_pack_N.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | test/ruby/test_pack.rb | 12 |
2 files changed, 16 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Fri Dec 26 14:05:13 2003 Minero Aoki <aamine@loveruby.net> + + * test/ruby/test_pack.rb: new test test_pack_N. + Fri Dec 26 10:58:58 2003 NAKAMURA Usaku <usa@ruby-lang.org> * MANIFEST: add vms/config.h and remove vms/config.h_in. diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index c7097af42..f8f9d7e74 100644 --- a/test/ruby/test_pack.rb +++ b/test/ruby/test_pack.rb @@ -18,4 +18,16 @@ class TestPack < Test::Unit::TestCase $x = [-1073741825] assert_equal($x, $x.pack("q").unpack("q")) end + + def test_pack_N + assert_equal "\000\000\000\000", [0].pack('N') + assert_equal "\000\000\000\001", [1].pack('N') + assert_equal "\000\000\000\002", [2].pack('N') + assert_equal "\000\000\000\003", [3].pack('N') + assert_equal "\377\377\377\376", [4294967294].pack('N') + assert_equal "\377\377\377\377", [4294967295].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 end |