mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
8ff550534e
commit
8cc42bc701
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue