more complex content length test

master
lurchi 2018-08-17 00:27:23 +02:00
parent bb8f7bd016
commit 90eb96c889
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 2 additions and 2 deletions

View File

@ -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"