From 06fb82343528ea1e479d10d97946862d8a3dff61 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 31 May 2014 14:48:12 +0000 Subject: Join threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_marshal.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 1bbc999258..64efe53bf5 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -102,17 +102,21 @@ class TestMarshal < Test::Unit::TestCase def test_pipe o1 = C.new("a" * 10000) + th = nil + o2 = IO.pipe do |r, w| - Thread.new {Marshal.dump(o1, w)} + th = Thread.new {Marshal.dump(o1, w)} Marshal.load(r) end assert_equal(o1.str, o2.str) + th.join o2 = IO.pipe do |r, w| - Thread.new {Marshal.dump(o1, w, 2)} + th = Thread.new {Marshal.dump(o1, w, 2)} Marshal.load(r) end assert_equal(o1.str, o2.str) + th.join assert_raise(TypeError) { Marshal.dump("foo", Object.new) } assert_raise(TypeError) { Marshal.load(Object.new) } -- cgit v1.2.3