aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_pair.rb
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-09-06 21:53:15 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-09-07 09:10:49 +0900
commitbb315a0be77fe792863d9eae70694997ca994e13 (patch)
tree82dd106da14889c052aa531a3893e0e9a8b327f1 /test/test_pair.rb
parentee37304b67fec137b383552e9fc74dc90905883b (diff)
downloadruby-openssl-bb315a0be77fe792863d9eae70694997ca994e13.tar.gz
test/test_pair: extract IO-like methods tests from test_ssl.rb
Move a test case of SSLSocket#gets to test_pair.rb, and remove test cases from test_ssl.rb which duplicate the tests in test_pair.rb
Diffstat (limited to 'test/test_pair.rb')
-rw-r--r--test/test_pair.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/test_pair.rb b/test/test_pair.rb
index 73d3e8d4..7d962c38 100644
--- a/test/test_pair.rb
+++ b/test/test_pair.rb
@@ -113,11 +113,25 @@ module OpenSSL::TestPairM
}
end
+ def test_gets
+ ssl_pair {|s1, s2|
+ s1 << "abc\n\n$def123ghi"
+ s1.close
+ ret = s2.gets
+ assert_equal Encoding::BINARY, ret.encoding
+ assert_equal "abc\n", ret
+ assert_equal "\n$", s2.gets("$")
+ assert_equal "def123", s2.gets(/\d+/)
+ assert_equal "ghi", s2.gets
+ assert_equal nil, s2.gets
+ }
+ end
+
def test_gets_eof_limit
ssl_pair {|s1, s2|
s1.write("hello")
s1.close # trigger EOF
- assert_match "hello", s2.gets("\n", 6), "[ruby-core:70149] [Bug #11140]"
+ assert_match "hello", s2.gets("\n", 6), "[ruby-core:70149] [Bug #11400]"
}
end