Project

General

Profile

Actions

Bug #7348

closed

marshaling an object by a float does not work

Added by tenderlovemaking (Aaron Patterson) about 12 years ago. Updated about 11 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0dev (2012-11-14 trunk 37650) [x86_64-darwin12.2.1]
Backport:
[ruby-core:49323]

Description

The below calls object doesn't round trip through marshal on edge ruby:

def test_marshal_object_and_float
e = Object.new
calls = []
calls << [2.0, e]
calls << [e]
assert_equal calls, Marshal.load(Marshal.dump(calls))
end

When I run this test case, for some reason, the float takes the place of the object in the second array:

[36/82] TestMarshal#test_marshal_object_and_float = 0.00 s

  1. Failure:
    test_marshal_object_and_float(TestMarshal) [/Users/aaron/git/ruby/test/ruby/test_marshal.rb:40]:
    <[[2.0, #Object:0x007fa5c20b08a0], [#Object:0x007fa5c20b08a0]]> expected but was
    <[[2.0, #Object:0x007fa5c20b05a8], [2.0]]>.

I've attached a failing test case.


Files

marshal_fail.patch (556 Bytes) marshal_fail.patch tenderlovemaking (Aaron Patterson), 11/14/2012 09:20 AM
flonum_marshal_dump.patch (954 Bytes) flonum_marshal_dump.patch nagachika (Tomoyuki Chikanaga), 11/16/2012 02:38 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0