summaryrefslogtreecommitdiff
path: root/test/openssl
diff options
context:
space:
mode:
authorSamuel Williams <[email protected]>2024-01-01 22:50:32 +1300
committergit <[email protected]>2024-01-13 00:28:26 +0000
commitf7178045bb11fc3722a98082ed81e1ec39c4940f (patch)
tree5e3d5561a09637a857ca75c08594af83225c7f76 /test/openssl
parent08d4e5ebef3d372ca52de95d8ed896d7def8de49 (diff)
[ruby/openssl] Add support for `gets(chomp: true)`.
https://github.com/ruby/openssl/commit/8aa3849cff
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/test_pair.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index 14786100df..b616883925 100644
--- a/test/openssl/test_pair.rb
+++ b/test/openssl/test_pair.rb
@@ -115,6 +115,17 @@ module OpenSSL::TestPairM
}
end
+ def test_gets_chomp
+ ssl_pair {|s1, s2|
+ s1 << "line1\r\nline2\r\nline3\r\n"
+ s1.close
+
+ assert_equal("line1", s2.gets("\r\n", chomp: true))
+ assert_equal("line2\r\n", s2.gets("\r\n", chomp: false))
+ assert_equal("line3", s2.gets(chomp: true))
+ }
+ end
+
def test_gets_eof_limit
ssl_pair {|s1, s2|
s1.write("hello")