summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-05 11:56:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-05 11:56:35 +0000
commitb2b5a5db0925f94220897813a552aa7d4ec2fd11 (patch)
tree9911a7cd10125ca0d9fcafc9d0c2c7e444abcc4a /test
parent5ba39a12d9273d37b0da9af7a388d0792e3894ef (diff)
pack.c: hide associated objects
* marshal.c (to_be_skipped_id): ignore anonymous attributes. * pack.c (Init_pack): use anonymous ID so that associated objects do not appear in the packed result. * parse.y (rb_make_internal_id): return an anonymous ID for internal use. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_marshal.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index 126efc8ae6..2c5b2aa765 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -595,4 +595,9 @@ class TestMarshal < Test::Unit::TestCase
Marshal.dump(TestForRespondToFalse.new)
end
end
+
+ def test_packed_string
+ packed = ["foo"].pack("p")
+ assert_equal(Marshal.dump(""+packed), Marshal.dump(packed))
+ end
end