File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -286,9 +286,20 @@ def _dump(level)
286286 ] . should be_computed_by ( :dump )
287287 end
288288
289- quarantine! do # fails on i686 with 'Expected "\x04\b[\af\x060f\x060" == "\x04\b[\af\x060@\x06" to be truthy but was false'
290- it "uses object links for objects repeatedly dumped" do
291- Marshal . dump ( [ 0.0 , 0.0 ] ) . should == "\x04 \b [\a f\x06 0@\x06 " # @\x06 is a link to the float value
289+ it "may or may not use object links for objects repeatedly dumped" do
290+ # it's an MRI implementation detail - on x86 architecture object links
291+ # aren't used for Float values but on amd64 - object links are used
292+
293+ dump = Marshal . dump ( [ 0.0 , 0.0 ] )
294+ [ "\x04 \b [\a f\x06 0@\x06 " , "\x04 \b [\a f\x06 0f\x06 0" ] . should . include? ( dump )
295+
296+ # if object links aren't used - entries in the objects table are still
297+ # occupied by Float values
298+ if dump == "\x04 \b [\a f\x06 0f\x06 0"
299+ s = "string"
300+ # an index of "string" ("@\b") in the object table equals 3 (`"\b".ord - 5`),
301+ # so `0.0, 0,0` elements occupied indices 1 and 2
302+ Marshal . dump ( [ 0.0 , 0.0 , s , s ] ) . should == "\x04 \b [\t f\x06 0f\x06 0\" \v string@\b "
292303 end
293304 end
294305 end
You can’t perform that action at this time.
0 commit comments