about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-11-11 07:31:01 +0800
committerEric Wong <normalperson@yhbt.net>2010-11-11 07:33:30 +0800
commit3b544fb2c0e4a1e14a7bcb752a8af9819b5aaeb2 (patch)
tree58004e676cf20a2d7b3913327fee7056ca2bbbb2
parenta89ccf321224f3248ddd00bb0edb320311604e4e (diff)
downloadunicorn-3b544fb2c0e4a1e14a7bcb752a8af9819b5aaeb2.tar.gz
We'll need this in Rainbows!
-rw-r--r--test/unit/test_http_parser_ng.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/test_http_parser_ng.rb b/test/unit/test_http_parser_ng.rb
index d430109..ce6c6e6 100644
--- a/test/unit/test_http_parser_ng.rb
+++ b/test/unit/test_http_parser_ng.rb
@@ -11,6 +11,19 @@ class HttpParserNgTest < Test::Unit::TestCase
     @parser = HttpParser.new
   end
 
+  def test_default_keepalive_is_off
+    assert ! @parser.keepalive?
+    assert ! @parser.next?
+    assert_nothing_raised do
+      @parser.buf << "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"
+      @parser.parse
+    end
+    assert @parser.keepalive?
+    @parser.reset
+    assert ! @parser.keepalive?
+    assert ! @parser.next?
+  end
+
   def test_identity_byte_headers
     req = {}
     str = "PUT / HTTP/1.1\r\n"