summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-06 00:50:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-06 00:50:22 +0000
commit38a9831caaed025a30b3a3027cd5f6129b258758 (patch)
treed90b521da6977d1affc2ebe24b7b08471510d69d
parentf167bc403d2d97ec27308a3c41b22ecc16294bbc (diff)
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
-rw-r--r--test/ruby/test_marshal.rb3
1 files changed, 2 insertions, 1 deletions
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