From cbf7d62712c44d2b3bbb066e6840041b89cfb6d9 Mon Sep 17 00:00:00 2001 From: nodist Date: Wed, 7 Oct 2026 16:44:38 -0400 Subject: tree impl --- test/test.c | 17 ++++++++++++++++- test/tree.c | 6 ++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/tree.c (limited to 'test') diff --git a/test/test.c b/test/test.c index 6cede92..02a8730 100644 --- a/test/test.c +++ b/test/test.c @@ -67,7 +67,22 @@ static int32_t kpl_test_run_all(void) { int32_t main(int32_t argc, char *argv[]) { if (argc < 2) return kpl_test_run_all(); - // TODO run by name + kpl_test find = {}; + for (int32_t arg_index = 1; arg_index < argc; arg_index++) { + find.name = argv[arg_index]; + kpl_test *found = kpl_tree_find(&test_tree, &find); + if (!found) { + printf(KPL_COLOR2(BOLD, RED) "TEST: " KPL_COLOR(RESET) KPL_COLOR2(BOLD, WHITE) "%s " KPL_COLOR(RESET) + KPL_COLOR2(BOLD, RED) "NOT FOUND\n" KPL_COLOR(RESET), find.name); + return KPL_EXIT_CODE_ERROR; + } + kpl_test *duplicates = found->tree_duplicates; + while (duplicates) { + kpl_test_run_one(duplicates); + duplicates = duplicates->tree_duplicates; + } + kpl_test_run_one(found); + } return kpl_test_report_error(); } diff --git a/test/tree.c b/test/tree.c new file mode 100644 index 0000000..caaa23a --- /dev/null +++ b/test/tree.c @@ -0,0 +1,6 @@ + +#include "kpl_test.h" + +KPL_TEST(c_string_trees) { + // TODO +} -- cgit v1.2.3