From c326ab8c743c342150f5d5f991ddd6f429ebdfa1 Mon Sep 17 00:00:00 2001 From: rhe Date: Thu, 29 Dec 2016 16:16:32 +0000 Subject: test/ruby/test_pack.rb: fix test case added by r57187 The test case for String#unpack added by r57187 is not properly testing because the String will be filled after the block invocation. [ruby-core:78841] [Bug #13075] Thanks to nagachika for pointing this out: http://d.hatena.ne.jp/nagachika/20161226/ruby_trunk_changes_57184_57194#r57187 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_pack.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/ruby/test_pack.rb') diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index 81b1a92383..6d2eecbc9f 100644 --- a/test/ruby/test_pack.rb +++ b/test/ruby/test_pack.rb @@ -841,7 +841,7 @@ EXPECTED def test_unpack_with_block ret = []; "ABCD".unpack("CCCC") {|v| ret << v } assert_equal [65, 66, 67, 68], ret - ret = []; "A".unpack("B*") {|v| ret << v } + ret = []; "A".unpack("B*") {|v| ret << v.dup } assert_equal ["01000001"], ret end -- cgit v1.2.3