Skip to content

Commit

Permalink
test/ruby/test_marshal.rb: close pipes
Browse files Browse the repository at this point in the history
* test/ruby/test_marshal.rb (TestMarshal#test_pipe): should close pipes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed May 15, 2012
1 parent 0682537 commit 498a001
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/ruby/test_marshal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,16 @@ def test_userdef_encoding
def test_pipe
o1 = C.new("a" * 10000)

r, w = IO.pipe
t = Thread.new { Marshal.load(r) }
Marshal.dump(o1, w)
o2 = t.value
o2 = IO.pipe do |r, w|
Thread.new {Marshal.dump(o1, w)}
Marshal.load(r)
end
assert_equal(o1.str, o2.str)

r, w = IO.pipe
t = Thread.new { Marshal.load(r) }
Marshal.dump(o1, w, 2)
o2 = t.value
o2 = IO.pipe do |r, w|
Thread.new {Marshal.dump(o1, w, 2)}
Marshal.load(r)
end
assert_equal(o1.str, o2.str)

assert_raise(TypeError) { Marshal.dump("foo", Object.new) }
Expand Down

0 comments on commit 498a001

Please sign in to comment.