pike.git/
src/
modules/
_Roxen/
testsuite.in
Branch:
Tag:
Non-build tags
All tags
No tags
2009-07-29
2009-07-29 15:49:05 by Martin Nilsson <mani@lysator.liu.se>
f2225c36eb81a8591fab228cc97d41c53f32ef4e (
17
lines) (+
17
/-
0
)
[
Show
|
Annotate
]
Branch:
7.9
A few tests
Rev: src/modules/_Roxen/testsuite.in:1.6
44:
test_mkhttp( (["a":"1","b":"2"]), ({"a: 1","b: 2"}) ) test_mkhttp( (["a":"1","b":({"2","3"})]), ({"a: 1","b: 2","b: 3"}) ) test_mkhttp( (["a":"1","b":({"2","2"})]), ({"a: 1","b: 2","b: 2"}) )
+
+
define(test_hp,[[
+
test_do( add_constant("hp", _Roxen.HeaderParser()) )
+
test_equal( hp->feed( $1 ), $2)
+
test_do( add_constant("hp") )
+
]])
+
+
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",
+
({ "", "GET / HTTP/1.0", ([ "blaha":({ "foo", "bar" }) ]) }) )
+
END_MARKER