* test/ruby/test_io.rb (test_dup_many): extracted from test_dup.
test in ruby subprocess. at asakusa.rb. [ruby-dev:35648] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
120ab4b826
commit
240378856b
@ -1,3 +1,8 @@
|
|||||||
|
Thu Dec 11 19:23:09 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* test/ruby/test_io.rb (test_dup_many): extracted from test_dup.
|
||||||
|
test in ruby subprocess. at asakusa.rb. [ruby-dev:35648]
|
||||||
|
|
||||||
Thu Dec 11 19:16:30 2008 Tanaka Akira <akr@fsij.org>
|
Thu Dec 11 19:16:30 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* lib/pathname.rb (Pathname#=~): undefed. at asakusa.rb.
|
* lib/pathname.rb (Pathname#=~): undefed. at asakusa.rb.
|
||||||
|
@ -651,18 +651,28 @@ class TestIO < Test::Unit::TestCase
|
|||||||
assert_equal("foo\nbar\n", f.read)
|
assert_equal("foo\nbar\n", f.read)
|
||||||
assert_equal("", f2.read)
|
assert_equal("", f2.read)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
a = []
|
def test_dup_many
|
||||||
assert_raise(Errno::EMFILE, Errno::ENFILE, Errno::ENOMEM) do
|
ruby('-e', <<-'End') {|f|
|
||||||
loop {a << IO.pipe}
|
ok = 0
|
||||||
end
|
a = []
|
||||||
assert_raise(Errno::EMFILE, Errno::ENFILE, Errno::ENOMEM) do
|
begin
|
||||||
loop {a << [a[-1][0].dup, a[-1][1].dup]}
|
loop {a << IO.pipe}
|
||||||
end
|
rescue Errno::EMFILE, Errno::ENFILE, Errno::ENOMEM
|
||||||
a.each do |r, w|
|
ok += 1
|
||||||
r.close unless !r || r.closed?
|
end
|
||||||
w.close unless !w || w.closed?
|
print "no" if ok != 1
|
||||||
end
|
begin
|
||||||
|
loop {a << [a[-1][0].dup, a[-1][1].dup]}
|
||||||
|
rescue Errno::EMFILE, Errno::ENFILE, Errno::ENOMEM
|
||||||
|
ok += 1
|
||||||
|
end
|
||||||
|
print "no" if ok != 2
|
||||||
|
print "ok"
|
||||||
|
End
|
||||||
|
assert_equal("ok", f.read)
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_inspect
|
def test_inspect
|
||||||
|
Loading…
x
Reference in New Issue
Block a user