kgio.git  about / heads / tags
kinder, gentler I/O for Ruby
blob 10033fee56bd8fb029de9e3784cb906551be7fc4 434 bytes (raw)
$ git show v2.3.0:test/test_default_wait.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 
require 'test/unit'
require 'io/nonblock'
$-w = true
require 'kgio'

class TestDefaultWait < Test::Unit::TestCase

  def test_socket_pair
    a, b = Kgio::UNIXSocket.pair
    assert_equal a, a.kgio_wait_writable
    a.syswrite('.')
    assert_equal b, b.kgio_wait_readable
  end

  def test_pipe
    a, b = Kgio::Pipe.new
    assert_equal b, b.kgio_wait_writable
    b.syswrite('.')
    assert_equal a, a.kgio_wait_readable
  end
end

git clone git://yhbt.net/kgio.git
git clone https://yhbt.net/kgio.git