summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-02-15 18:37:10 +0000
committerEric Wong <e@80x24.org>2017-02-15 18:37:10 +0000
commitc4b58719e8aa7f2b4979d139ca166a8c6a11eb7e (patch)
treeacd230d4564b1631ac15d988e20beaf234469fb5
parente06b699683738f22fcbec1a4ad42d1a4095ec396 (diff)
Oops, this was a half-baked change I was considering
but forgot about.

This reverts commit 69fd4f9bbff3708166fbf70163fa6e192dde1497.
-rw-r--r--test/unit/test_http_parser_ng.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/test_http_parser_ng.rb b/test/unit/test_http_parser_ng.rb
index 9300c57..d186f5a 100644
--- a/test/unit/test_http_parser_ng.rb
+++ b/test/unit/test_http_parser_ng.rb
@@ -21,14 +21,28 @@ class HttpParserNgTest < Test::Unit::TestCase
     r = "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"
     @parser.buf << r
     @parser.parse
+    @parser.response_start_sent = true
     assert @parser.keepalive?
     assert @parser.next?
+    assert @parser.response_start_sent
 
     # persistent client makes another request:
     @parser.buf << r
     @parser.parse
     assert @parser.keepalive?
     assert @parser.next?
+    assert_equal false, @parser.response_start_sent
+  end
+
+  def test_response_start_sent
+    assert_equal false, @parser.response_start_sent, "default is false"
+    @parser.response_start_sent = true
+    assert_equal true, @parser.response_start_sent
+    @parser.response_start_sent = false
+    assert_equal false, @parser.response_start_sent
+    @parser.response_start_sent = true
+    @parser.clear
+    assert_equal false, @parser.response_start_sent
   end
 
   def test_connection_TE