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

ruby-changes:32775

From: nobu <ko1@a...>
Date: Thu, 6 Feb 2014 09:50:26 +0900 (JST)
Subject: [ruby-changes:32775] nobu:r44854 (trunk): test_marshal.rb: fix test depending on heap address

nobu	2014-02-06 09:50:22 +0900 (Thu, 06 Feb 2014)

  New Revision: 44854

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44854

  Log:
    test_marshal.rb: fix test depending on heap address
    
    * test/ruby/test_marshal.rb (test_packed_string): explicitly force
      encoding for the case packed string is 7bit ASCII only.

  Modified files:
    trunk/test/ruby/test_marshal.rb
Index: test/ruby/test_marshal.rb
===================================================================
--- test/ruby/test_marshal.rb	(revision 44853)
+++ test/ruby/test_marshal.rb	(revision 44854)
@@ -598,6 +598,7 @@ class TestMarshal < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_marshal.rb#L598
 
   def test_packed_string
     packed = ["foo"].pack("p")
-    assert_equal(Marshal.dump(""+packed), Marshal.dump(packed))
+    bare = "".force_encoding(Encoding::ASCII_8BIT) << packed
+    assert_equal(Marshal.dump(bare), Marshal.dump(packed))
   end
 end

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

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