kcar RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [PATCH] test_parser: add lone CR test
@ 2017-03-05  2:06 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2017-03-05  2:06 UTC (permalink / raw)
  To: kcar-public

Just out of paranoia...
---
 test/test_parser.rb | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/test_parser.rb b/test/test_parser.rb
index c8eaa4d..c0a05f1 100644
--- a/test/test_parser.rb
+++ b/test/test_parser.rb
@@ -254,6 +254,12 @@ class TestParser < Test::Unit::TestCase
     end
   end
 
+  def test_bad_cr
+    assert_raises(Kcar::ParserError) do
+      @hp.headers([], "HTTP/1.1 200 OK\r\nContent-Length: 5\r\nA:\rb")
+    end
+  end
+
   def test_leading_tab
     resp = "HTTP/1.1 200 OK\r\nHost:\texample.com\r\n\r\n"
     assert @hp.headers(env = {}, resp)
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-05  2:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-05  2:06 [PATCH] test_parser: add lone CR test Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/kcar.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).