mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
0dbe6b6113
commit
8b09bf2a72
3 changed files with 13 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue