summaryrefslogtreecommitdiffstats
path: root/test/test_pair.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@ruby-lang.org>2014-05-27 10:03:09 +0000
committerhsbt <hsbt@ruby-lang.org>2014-05-27 10:03:09 +0000
commita42d1c926e301d30a7e6e4d35e80724e7107122b (patch)
tree5051f282761e24ea3022e73fbdb0fa16388d38b4 /test/test_pair.rb
parent1e7ff2ed1e6231e7771de798d313eb08eb47b7c1 (diff)
downloadruby-openssl-history-a42d1c926e301d30a7e6e4d35e80724e7107122b.tar.gz
* 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
Diffstat (limited to 'test/test_pair.rb')
-rw-r--r--test/test_pair.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/test_pair.rb b/test/test_pair.rb
index c7cfd69..c2ad735 100644
--- a/test/test_pair.rb
+++ b/test/test_pair.rb
@@ -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) }