more complex content length test
This commit is contained in:
parent
bb8f7bd016
commit
90eb96c889
|
@ -301,10 +301,10 @@ suite "parser tests":
|
||||||
check(packet.data == "Hello Alice!")
|
check(packet.data == "Hello Alice!")
|
||||||
|
|
||||||
test "content length":
|
test "content length":
|
||||||
let input = ":_target\talice\n25\n_hello_world\nHello Alice!\n|\n"
|
let input = ":_target\talice\n39\n:_hello\tworld\n_hello_world\nHello Alice!\n|\n"
|
||||||
while packet.state != ParseState.Complete:
|
while packet.state != ParseState.Complete:
|
||||||
discard parse(input, packet)
|
discard parse(input, packet)
|
||||||
check(packet.contentLength == 25)
|
check(packet.contentLength == 39)
|
||||||
check(packet.data == "Hello Alice!")
|
check(packet.data == "Hello Alice!")
|
||||||
|
|
||||||
echo "parser tests completed"
|
echo "parser tests completed"
|
||||||
|
|
Loading…
Reference in New Issue