about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <bofh@yhbt.net>2023-06-01 21:19:35 +0000
committerEric Wong <bofh@yhbt.net>2023-06-05 09:17:18 +0000
commit66c4ed7957459de270cffedfd494562359386d4e (patch)
tree2c780b220798a615fc97f350355831eda093064f /test
parent9d7bab0bc2211b20806d4d0289a7ea992e49a8a1 (diff)
downloadunicorn-66c4ed7957459de270cffedfd494562359386d4e.tar.gz
Rack::Chunked will be gone in Rack 3.1, so provide a
non-middleware fallback which takes advantage of IO#write
supporting multiple arguments in Ruby 2.5+.

We still need to support Ruby 2.4, at least, since Rack 3.0
does.  So a new (GC-unfriendly) Unicorn::WriteSplat module now
exists for Ruby <= 2.4 users.
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_server.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/unit/test_server.rb b/test/unit/test_server.rb
index 98e85ab..fe98fcc 100644
--- a/test/unit/test_server.rb
+++ b/test/unit/test_server.rb
@@ -196,7 +196,7 @@ class WebServerTest < Test::Unit::TestCase
     # continue to process our request and never hit EOFError on our sock
     sock.shutdown(Socket::SHUT_WR)
     buf = sock.read
-    assert_equal 'hello!\n', buf.split(/\r\n\r\n/).last
+    assert_match %r{\bhello!\\n\b}, buf.split(/\r\n\r\n/, 2).last
     next_client = Net::HTTP.get(URI.parse("http://127.0.0.1:#@port/"))
     assert_equal 'hello!\n', next_client
     lines = File.readlines("test_stderr.#$$.log")