mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
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:
parent
81fd43b4ce
commit
b1bf12f146
2 changed files with 26 additions and 0 deletions
16
Tests/base/GSMime/HTTP2.dat
Normal file
16
Tests/base/GSMime/HTTP2.dat
Normal 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
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue