diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-15 21:39:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-15 21:39:39 +0000 |
commit | 8b09bf2a72e4e59bb5107c15be367cf8808e6667 (patch) | |
tree | 9eee998a6a1810b7bc297ceb5e8df57357655eca /test/ruby/test_pack.rb | |
parent | 0dbe6b611339af6a95eadd56d327d27c1ae9131b (diff) | |
download | ruby-8b09bf2a72e4e59bb5107c15be367cf8808e6667.tar.gz |
* pack.c (PACK_ITEM_ADJUST): return nil not result array and yield
values if block is given. [ruby-core:33193]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_pack.rb')
-rw-r--r-- | test/ruby/test_pack.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index 83b4582776..a668f7b218 100644 --- a/test/ruby/test_pack.rb +++ b/test/ruby/test_pack.rb @@ -630,4 +630,11 @@ class TestPack < Test::Unit::TestCase assert_equal([1,nil], str.unpack("#{fmt}2")) } end + + def test_short_with_block + bug4059 = '[ruby-core:33193]' + result = :ok + assert_nil("".unpack("i") {|x| result = x}, bug4059) + assert_equal(:ok, result) + end end |