[前][次][番号順一覧][スレッド一覧]

ruby-changes:45161

From: rhe <ko1@a...>
Date: Fri, 30 Dec 2016 01:16:37 +0900 (JST)
Subject: [ruby-changes:45161] rhe:r57234 (trunk): test/ruby/test_pack.rb: fix test case added by r57187

rhe	2016-12-30 01:16:32 +0900 (Fri, 30 Dec 2016)

  New Revision: 57234

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57234

  Log:
    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

  Modified files:
    trunk/test/ruby/test_pack.rb
Index: test/ruby/test_pack.rb
===================================================================
--- test/ruby/test_pack.rb	(revision 57233)
+++ test/ruby/test_pack.rb	(revision 57234)
@@ -841,7 +841,7 @@ EXPECTED https://github.com/ruby/ruby/blob/trunk/test/ruby/test_pack.rb#L841
   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
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]