diff options
-rw-r--r-- | test/ruby/test_marshal.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 64efe53bf5..0b7a121185 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -102,21 +102,19 @@ class TestMarshal < Test::Unit::TestCase def test_pipe o1 = C.new("a" * 10000) - th = nil - - o2 = IO.pipe do |r, w| + IO.pipe do |r, w| th = Thread.new {Marshal.dump(o1, w)} - Marshal.load(r) + o2 = Marshal.load(r) + th.join + assert_equal(o1.str, o2.str) end - assert_equal(o1.str, o2.str) - th.join - o2 = IO.pipe do |r, w| + IO.pipe do |r, w| th = Thread.new {Marshal.dump(o1, w, 2)} - Marshal.load(r) + o2 = Marshal.load(r) + th.join + assert_equal(o1.str, o2.str) end - assert_equal(o1.str, o2.str) - th.join assert_raise(TypeError) { Marshal.dump("foo", Object.new) } assert_raise(TypeError) { Marshal.load(Object.new) } |