From 38a9831caaed025a30b3a3027cd5f6129b258758 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 6 Feb 2014 00:50:22 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_marshal.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 2c5b2aa765..6b7c9c105f 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -598,6 +598,7 @@ class TestMarshal < Test::Unit::TestCase 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