diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_proxy_pass.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_proxy_pass.rb b/test/test_proxy_pass.rb index 840ad1c..a27a45e 100644 --- a/test/test_proxy_pass.rb +++ b/test/test_proxy_pass.rb @@ -437,6 +437,16 @@ class TestProxyPass < Testcase end re = /^Date:[^\r\n]+/ assert_equal after_up.sub(re, ''), r1.sub(re, '') + + pl.write "GET / HTTP/1.1\r\nHost: example.com" + sleep 0.1 # hope epoll wakes up and reads in this time + pl.write "\r\n\r\nGET / HTTP/1.1\r\nHost: example.com\r\n\r\n" + burst = pl.readpartial(666) + until burst.scan(/^hi$/).size == 2 + burst << pl.readpartial(666) + end + assert_equal 2, burst.scan(/^hi$/).size + assert_match %r{\r\n\r\nhi\n\z}, burst end r1 = r1.split("\r\n").reject { |x| x =~ /^Date: / } r2 = r2.split("\r\n").reject { |x| x =~ /^Date: / } |