--- a/test/utils.c Sat Jan 17 10:29:38 2026 +0100 +++ b/test/utils.c Fri Jan 23 17:38:59 2026 +0100 @@ -198,3 +198,23 @@ free(str); } } + +CX_TEST(test_util_parent_path) { + CX_TEST_DO { + char *parent = util_parent_path("/hello"); + CX_TEST_ASSERT(!cx_strcmp(parent, "/")); + free(parent); + + parent = util_parent_path("/"); + CX_TEST_ASSERT(!cx_strcmp(parent, "")); + free(parent); + + parent = util_parent_path("/long/path/123/4567890/test/"); + CX_TEST_ASSERT(!cx_strcmp(parent, "/long/path/123/4567890/")); + free(parent); + + parent = util_parent_path("/long/path/123/4567890/test"); + CX_TEST_ASSERT(!cx_strcmp(parent, "/long/path/123/4567890/")); + free(parent); + } +}