mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/io/wait/test_io_wait.rb: skip tests if the platform is
mswin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
21fcb1c3a1
commit
70e9201610
2 changed files with 12 additions and 0 deletions
|
@ -17,18 +17,21 @@ class TestIOWait < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_nread
|
||||
return if /mswin/ =~ RUBY_PLATFORM
|
||||
assert_equal 0, @r.nread
|
||||
@w.syswrite "."
|
||||
assert_equal 1, @r.nread
|
||||
end
|
||||
|
||||
def test_nread_buffered
|
||||
return if /mswin/ =~ RUBY_PLATFORM
|
||||
@w.syswrite ".\n!"
|
||||
assert_equal ".\n", @r.read(2)
|
||||
assert_equal 1, @r.nread
|
||||
end
|
||||
|
||||
def test_ready?
|
||||
return if /mswin/ =~ RUBY_PLATFORM
|
||||
refute @r.ready?
|
||||
@w.syswrite "."
|
||||
assert @r.ready?
|
||||
|
@ -41,23 +44,27 @@ class TestIOWait < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_wait
|
||||
return if /mswin/ =~ RUBY_PLATFORM
|
||||
assert_nil @r.wait(0)
|
||||
@w.syswrite "."
|
||||
assert_equal @r, @r.wait(0)
|
||||
end
|
||||
|
||||
def test_wait_buffered
|
||||
return if /mswin/ =~ RUBY_PLATFORM
|
||||
@w.syswrite ".\n!"
|
||||
assert_equal ".\n", @r.gets
|
||||
assert_equal true, @r.wait(0)
|
||||
end
|
||||
|
||||
def test_wait_forever
|
||||
return if /mswin/ =~ RUBY_PLATFORM
|
||||
Thread.new { sleep 0.01; @w.syswrite "." }
|
||||
assert_equal @r, @r.wait
|
||||
end
|
||||
|
||||
def test_wait_eof
|
||||
return if /mswin/ =~ RUBY_PLATFORM
|
||||
Thread.new { sleep 0.01; @w.close }
|
||||
assert_nil @r.wait
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue