@@ -72,6 +72,8 @@ HTTP_RESOURCE_DEFINE(resource_5, service_D, "/fo*", RES(1));
7272HTTP_RESOURCE_DEFINE (resource_6 , service_D , "/f[ob]o3.html" , RES (1 ));
7373HTTP_RESOURCE_DEFINE (resource_7 , service_D , "/fb?3.htm" , RES (0 ));
7474HTTP_RESOURCE_DEFINE (resource_8 , service_D , "/f*4.html" , RES (3 ));
75+ HTTP_RESOURCE_DEFINE (resource_11 , service_D , "/foo/*" , RES (3 ));
76+ HTTP_RESOURCE_DEFINE (resource_12 , service_D , "/foo/b?r" , RES (3 ));
7577
7678
7779ZTEST (http_service , test_HTTP_SERVICE_DEFINE )
@@ -327,6 +329,25 @@ ZTEST(http_service, test_HTTP_RESOURCE_WILDCARD)
327329 zassert_not_null (res , "Cannot find resource" );
328330 zassert_true (len > 0 , "Length not set" );
329331 zassert_equal (res , RES (3 ), "Resource mismatch" );
332+
333+ res = CHECK_PATH ("/foo/bar" , & len );
334+ zassert_not_null (res , "Resource not found" );
335+ zassert_true (len == (sizeof ("/foo/bar" ) - 1 ), "Length not set correctly" );
336+ zassert_equal (res , RES (3 ), "Resource mismatch" );
337+
338+ res = CHECK_PATH ("/foo/bar?param=value" , & len );
339+ zassert_not_null (res , "Resource not found" );
340+ zassert_true (len == (sizeof ("/foo/bar" ) - 1 ), "Length not set correctly" );
341+ zassert_equal (res , RES (3 ), "Resource mismatch" );
342+
343+ res = CHECK_PATH ("/bar?foo=value" , & len );
344+ zassert_is_null (res , "Resource found" );
345+ zassert_equal (len , 0 , "Length set" );
346+
347+ res = CHECK_PATH ("/foo/bar?param=value" , & len );
348+ zassert_not_null (res , "Resource not found" );
349+ zassert_true (len == (sizeof ("/foo/bar" ) - 1 ), "Length not set correctly" );
350+ zassert_equal (res , RES (3 ), "Resource mismatch" );
330351}
331352
332353ZTEST_SUITE (http_service , NULL , NULL , NULL , NULL , NULL );
0 commit comments