mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 07:28:13 +08:00
Add more mg_http_parse unit tests
This commit is contained in:
parent
9657577c00
commit
749326c83a
@ -816,6 +816,14 @@ static void test_http_parse(void) {
|
||||
ASSERT(mg_strcmp(s, res) == 0);
|
||||
mg_iobuf_free(&c.send);
|
||||
}
|
||||
|
||||
{
|
||||
struct mg_http_message hm;
|
||||
const char *req = "GET /foo?bar=baz HTTP/1.0\n\n ";
|
||||
ASSERT(mg_http_parse(req, strlen(req), &hm) == (int) strlen(req) - 1);
|
||||
ASSERT(mg_strcmp(hm.uri, mg_str("/foo")) == 0);
|
||||
ASSERT(mg_strcmp(hm.query, mg_str("bar=baz")) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_http_range(void) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user