Differences From Artifact [704975d98c]:
- File
tests/OFHTTPClientTests.m
— part of check-in
[dc0c6c34ab]
at
2019-02-17 22:44:23
on branch trunk
— tests: Only import ObjFW.h
This prevents forgetting to add an import to ObjFW.h, as the tests would
then not compile. (user: js, size: 3752) [annotate] [blame] [check-ins using]
To Artifact [a26978f51b]:
- File tests/OFHTTPClientTests.m — part of check-in [b045cbb9c7] at 2019-03-25 00:21:30 on branch trunk — tests: Use dot syntax (user: js, size: 3736) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
126 127 128 129 130 131 132 | [cond unlock]; URL = [OFURL URLWithString: [OFString stringWithFormat: @"http://127.0.0.1:%" @PRIu16 "/foo", server->_port]]; TEST(@"-[asyncPerformRequest:]", | | | | | | | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | [cond unlock]; URL = [OFURL URLWithString: [OFString stringWithFormat: @"http://127.0.0.1:%" @PRIu16 "/foo", server->_port]]; TEST(@"-[asyncPerformRequest:]", (client = [OFHTTPClient client]) && (client.delegate = self) && (request = [OFHTTPRequest requestWithURL: URL]) && (request.headers = [OFDictionary dictionaryWithObject: @"5" forKey: @"Content-Length"]) && R([client asyncPerformRequest: request])) [[OFRunLoop mainRunLoop] runUntilDate: [OFDate dateWithTimeIntervalSinceNow: 2]]; [response autorelease]; TEST(@"Asynchronous handling of requests", response != nil) TEST(@"Normalization of server header keys", [response.headers objectForKey: @"Content-Length"] != nil) TEST(@"Correct parsing of data", (data = [response readDataUntilEndOfStream]) && data.count == 7 && memcmp(data.items, "foo\nbar", 7) == 0) [server join]; [pool drain]; } @end |