diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-31 14:48:12 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-31 14:48:12 +0000 |
commit | 06fb82343528ea1e479d10d97946862d8a3dff61 (patch) | |
tree | 395eaffec6ffe59375e1c651e159c21d24c505d3 | |
parent | 45328723409d547e61d9746230f8f7ba15a346f2 (diff) | |
download | ruby-06fb82343528ea1e479d10d97946862d8a3dff61.tar.gz |
Join threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_marshal.rb | 8 |
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) } |