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
This commit is contained in:
parent
f167bc403d
commit
38a9831caa
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user