зеркало из https://github.com/github/ruby.git
add a test for OpenSSL::SSL::SSLSocket#read_nonblock.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8ff550534e
Коммит
8cc42bc701
|
@ -144,6 +144,18 @@ class OpenSSL::TestPair < Test::Unit::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
def test_read_nonblock
|
||||
ssl_pair {|s1, s2|
|
||||
assert_raise(Errno::EWOULDBLOCK) { s2.read_nonblock(10) }
|
||||
s1.write "abc\ndef\n"
|
||||
assert_equal("ab", s2.read_nonblock(2))
|
||||
assert_equal("c\n", s2.gets)
|
||||
ret = nil
|
||||
assert_nothing_raised("[ruby-core:20298]") { ret = s2.read_nonblock(10) }
|
||||
assert_equal("def\n", ret)
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче