pike.git
/
src
/
modules
/
_Roxen
/
testsuite.in
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/_Roxen/testsuite.in:57:
test_eval_error(_Roxen.make_http_headers((["a:1": "1"]))) test_eval_error(_Roxen.make_http_headers((["a\rb": "1"]))) test_eval_error(_Roxen.make_http_headers((["a\nb": "1"]))) test_eval_error(_Roxen.make_http_headers(([" a:1": "1"]))) test_eval_error(_Roxen.make_http_headers((["a": "1\r"]))) test_eval_error(_Roxen.make_http_headers((["a": "1\n"]))) test_eval_error(_Roxen.make_http_headers((["a": ({ "1\r\nb:2", "2\r\nc:2" }))))) define(test_hp,[[
-
test_
do( add
_
constant
(
"
hp
",
_Roxen.HeaderParser()
) )
-
test_equal(
hp->feed( $1 )
, $2)
-
test_do(
add_constant("hp"
)
)
+
test_
any_equal
(
[[
+
object
hp
=
_Roxen.HeaderParser()
;
+
return
hp->feed( $1 )
;
+
]],
$2
)
]])
-
test_hp( "GET / HTTP/1.
0\r\nblaha
: foo\nbar\r\nzonk: 1\r\n\r\n",
+
test_hp( "GET / HTTP/1.
0\r\n\r\n",
+
({ "", "GET / HTTP/1.0", ([]) }))
+
+
test_hp( "GET / HTTP/1.0\r\n\r\nDATA",
+
({ "DATA", "GET / HTTP/1.0", ([]) }))
+
+
test_hp( "GET / HTTP/1.0\r\nhdr
:
1\r\n\r\nDATA",
+
({ "DATA", "GET / HTTP/1.0", ([ "hdr":"1"]) }))
+
+
test_hp( "GET / HTTP/1.0\r\nBlaha:
foo\nbar\r\nzonk: 1\r\n\r\n",
({ "", "GET / HTTP/1.0", ([ "blaha":"foo", "zonk":"1" ]) }) ) test_hp( "GET / HTTP/1.0\r\nblaha: foo\r\nzonk: 1\r\n\r\n", ({ "", "GET / HTTP/1.0", ([ "blaha":"foo", "zonk":"1" ]) }) )
-
test_hp( "GET / HTTP/1.0\r\nblaha:
foo\n\rblaha
: bar\r\n\r\n",
+
test_hp( "GET / HTTP/1.0\r\nblaha:
foo\n\rBlaha
: bar\r\n\r\n",
({ "", "GET / HTTP/1.0", ([ "blaha":({ "foo", "bar" }) ]) }) )
-
+
test_any_equal([[
+
object hp = _Roxen.HeaderParser(0, 1);
+
return hp->feed( "GET / HTTP/1.0\r\nBlaha: foo\r\nblaha: foo\r\n\r\n" );
+
]], [[ ({ "", "GET / HTTP/1.0", ([ "Blaha":"foo", "blaha":"foo"]) }) ]])
+
+
test_any_equal([[
+
object hp = _Roxen.HeaderParser(0, 0);
+
return hp->feed( "GET / HTTP/1.0\r\nBlaha: foo\r\nblaha: foo\r\n\r\n", 1 );
+
]], [[ ({ "", "GET / HTTP/1.0", ([ "Blaha":"foo", "blaha":"foo"]) }) ]])
+
END_MARKER