From 0a8d8b8a684dc66669c6b2add3637c78673a97fe Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 18 Oct 2010 04:12:35 +0000 Subject: * pack.c (pack_pack): Add native size option ! to q and Q. [ruby-dev:42375] * pack.c (pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_pack.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index 83b4582776..0c5f0383b0 100644 --- a/test/ruby/test_pack.rb +++ b/test/ruby/test_pack.rb @@ -85,7 +85,9 @@ class TestPack < Test::Unit::TestCase assert_match(/\A\x00*\x01\x02\x03\x04\z/, [0x01020304].pack("I!"+mod)) assert_match(/\A\x00*\x01\x02\x03\x04\z/, [0x01020304].pack("l!"+mod)) assert_match(/\A\x00*\x01\x02\x03\x04\z/, [0x01020304].pack("L!"+mod)) - %w[s S l L q Q s! S! i I i! I! l! L!].each {|fmt| + assert_match(/\A\x00*\x01\x02\x03\x04\z/, [0x01020304].pack("q!"+mod)) + assert_match(/\A\x00*\x01\x02\x03\x04\z/, [0x01020304].pack("Q!"+mod)) + %w[s S l L q Q s! S! i I i! I! l! L! q! Q!].each {|fmt| fmt += mod nuls = [0].pack(fmt) v = 0 @@ -118,7 +120,9 @@ class TestPack < Test::Unit::TestCase assert_match(/\A\x04\x03\x02\x01\x00*\z/, [0x01020304].pack("I!"+mod)) assert_match(/\A\x04\x03\x02\x01\x00*\z/, [0x01020304].pack("l!"+mod)) assert_match(/\A\x04\x03\x02\x01\x00*\z/, [0x01020304].pack("L!"+mod)) - %w[s S l L q Q s! S! i I i! I! l! L!].each {|fmt| + assert_match(/\A\x04\x03\x02\x01\x00*\z/, [0x01020304].pack("q!"+mod)) + assert_match(/\A\x04\x03\x02\x01\x00*\z/, [0x01020304].pack("Q!"+mod)) + %w[s S l L q Q s! S! i I i! I! l! L! q! Q!].each {|fmt| fmt += mod nuls = [0].pack(fmt) v = 0 -- cgit v1.2.3