Branch: Tag:

2009-07-29

2009-07-29 15:49:05 by Martin Nilsson <mani@lysator.liu.se>

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