repo.or.cz
/
kgio.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
doc: fix accept -> tryaccept copy+paste error
[kgio.git]
/
test
/
test_default_wait.rb
blob
10033fee56bd8fb029de9e3784cb906551be7fc4
1
require 'test/unit'
2
require 'io/nonblock'
3
$-w = true
4
require 'kgio'
5
6
class TestDefaultWait < Test::Unit::TestCase
7
8
def test_socket_pair
9
a, b = Kgio::UNIXSocket.pair
10
assert_equal a, a.kgio_wait_writable
11
a.syswrite('.')
12
assert_equal b, b.kgio_wait_readable
13
end
14
15
def test_pipe
16
a, b = Kgio::Pipe.new
17
assert_equal b, b.kgio_wait_writable
18
b.syswrite('.')
19
assert_equal a, a.kgio_wait_readable
20
end
21
end