diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-16 15:55:59 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-16 15:55:59 +0000 |
commit | f45f668fa14104dab9c0e7712b6f3a3ab3d26558 (patch) | |
tree | d0cac688def5ebb29176d2f26a39f57c729f28ef /test | |
parent | 6379b316bbd74e299d0f9c5d9e6fc0f2d8fffecb (diff) | |
download | ruby-f45f668fa14104dab9c0e7712b6f3a3ab3d26558.tar.gz |
* marshal.c (w_object): add flonum to arg->data to keep reference index
consistency. [ruby-core:49323] [Bug #7348]
* test/ruby/test_marshal.rb: add a test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_marshal.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 85cec0adca..e68839472d 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -492,4 +492,11 @@ class TestMarshal < Test::Unit::TestCase assert_equal(Rational(1, 2), Marshal.load("\x04\bU:\rRational[\ai\x06i\a")) assert_raise(ArgumentError){Marshal.load("\x04\bU:\rRational[\bi\x00i\x00i\x00")} end + + def test_marshal_flonum_reference + bug7348 = '[ruby-core:49323]' + e = [] + ary = [ [2.0, e], [e] ] + assert_equal(ary, Marshal.load(Marshal.dump(ary)), bug7348) + end end |