feat: implement router free function
This commit is contained in:
parent
9fa009ccf4
commit
fbd41f7e4e
3 changed files with 25 additions and 5 deletions
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
void test_routing_simple() {
|
||||
lnm_http_router *router;
|
||||
lnm_http_router_init(&router);
|
||||
TEST_CHECK(lnm_http_router_init(&router) == lnm_err_ok);
|
||||
|
||||
TEST_CHECK(lnm_http_router_add(NULL, router, lnm_http_method_get, "/test") == lnm_err_ok);
|
||||
TEST_CHECK(lnm_http_router_add(NULL, router, lnm_http_method_get, "/test/test2") == lnm_err_ok);
|
||||
|
|
@ -37,6 +37,8 @@ void test_routing_simple() {
|
|||
TEST_CHECK((segment = lnm_http_route_match_get(&match, "hello")) != NULL);
|
||||
TEST_CHECK(segment->start == 6);
|
||||
TEST_CHECK(segment->len == 8);
|
||||
|
||||
lnm_http_router_free(router);
|
||||
}
|
||||
|
||||
TEST_LIST = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue