mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/openssl/test_pair.rb: Modify TestSSL#test_read_and_write
to handle partial sysreads. [Bug #7398][ruby-core:49563] * test/openssl/test_ssl.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
08e9b7d66c
commit
6eb8acae90
3 changed files with 18 additions and 4 deletions
|
@ -112,9 +112,13 @@ module OpenSSL::TestPairM
|
|||
ssl_pair {|s1, s2|
|
||||
s2.write "a\nbcd"
|
||||
assert_equal("a\n", s1.gets)
|
||||
assert_equal("bcd", s1.readpartial(10))
|
||||
result = ""
|
||||
result << s1.readpartial(10) until result.length == 3
|
||||
assert_equal("bcd", result)
|
||||
s2.write "efg"
|
||||
assert_equal("efg", s1.readpartial(10))
|
||||
result = ""
|
||||
result << s1.readpartial(10) until result.length == 3
|
||||
assert_equal("efg", result)
|
||||
s2.close
|
||||
assert_raise(EOFError) { s1.readpartial(10) }
|
||||
assert_raise(EOFError) { s1.readpartial(10) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue