summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-15 21:39:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-15 21:39:39 +0000
commit8b09bf2a72e4e59bb5107c15be367cf8808e6667 (patch)
tree9eee998a6a1810b7bc297ceb5e8df57357655eca /test
parent0dbe6b611339af6a95eadd56d327d27c1ae9131b (diff)
* 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')
-rw-r--r--test/ruby/test_pack.rb7
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