add simple chunked decoding test

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34874 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2012-03-03 18:51:10 +00:00
parent 81fd43b4ce
commit b1bf12f146
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,16 @@
HTTP/1.1 200 OK
Content-Type: text/plain
Transfer-Encoding: chunked
25
This is the data in the first chunk
1C
and this is the second one
3
con
8
sequence
0

View file

@ -70,6 +70,16 @@ int main()
PASS ([parser parse: data] == NO, "can parse HTTP 200 reponse in one go");
PASS ([parser isComplete], "parse is complete");
data = [NSData dataWithContentsOfFile: @"HTTP2.dat"];
parser = [GSMimeParser mimeParser];
PASS ([parser parse: data] == NO, "can parse HTTP chunked in one go");
PASS ([parser isComplete], "parse is complete");
PASS ([parser isComplete], "parse is complete");
PASS_EQUAL([[parser document] convertToText],
@"This is the data in the first chunk\r\nand this is the second one\r\n"
@"consequence", "content correct");
[arp release]; arp = nil;
return 0;
}