From 8b09bf2a72e4e59bb5107c15be367cf8808e6667 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 15 Nov 2010 21:39:39 +0000 Subject: * 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 --- test/ruby/test_pack.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') 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 -- cgit v1.2.3