mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
2 changed files with 26 additions and 11 deletions
|
@ -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>
|
||||
|
||||
* 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("", f2.read)
|
||||
end
|
||||
end
|
||||
|
||||
a = []
|
||||
assert_raise(Errno::EMFILE, Errno::ENFILE, Errno::ENOMEM) do
|
||||
loop {a << IO.pipe}
|
||||
end
|
||||
assert_raise(Errno::EMFILE, Errno::ENFILE, Errno::ENOMEM) do
|
||||
loop {a << [a[-1][0].dup, a[-1][1].dup]}
|
||||
end
|
||||
a.each do |r, w|
|
||||
r.close unless !r || r.closed?
|
||||
w.close unless !w || w.closed?
|
||||
end
|
||||
def test_dup_many
|
||||
ruby('-e', <<-'End') {|f|
|
||||
ok = 0
|
||||
a = []
|
||||
begin
|
||||
loop {a << IO.pipe}
|
||||
rescue Errno::EMFILE, Errno::ENFILE, Errno::ENOMEM
|
||||
ok += 1
|
||||
end
|
||||
print "no" if ok != 1
|
||||
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
|
||||
|
||||
def test_inspect
|
||||
|
|
Loading…
Reference in a new issue