summaryrefslogtreecommitdiff
path: root/test/ruby/test_marshal.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-31 14:48:12 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-31 14:48:12 +0000
commit06fb82343528ea1e479d10d97946862d8a3dff61 (patch)
tree395eaffec6ffe59375e1c651e159c21d24c505d3 /test/ruby/test_marshal.rb
parent45328723409d547e61d9746230f8f7ba15a346f2 (diff)
Join threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_marshal.rb')
-rw-r--r--test/ruby/test_marshal.rb8
1 files 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) }