tests: slight cleanliness

This commit is contained in:
2026-02-05 05:10:06 +00:00
parent 2705ef9bb7
commit 16be3392b0
4 changed files with 9 additions and 9 deletions

View File

@@ -17,10 +17,10 @@
#include "./test_vec.c"
test_suite_t SUITES[] = {
VEC_SUITE,
SV_SUITE,
SYMTABLE_SUITE,
LISP_API_SUITE,
SV_SUITE,
VEC_SUITE,
};
int main(void)

View File

@@ -32,6 +32,7 @@ void sym_test(void)
{
sys_t system = {0};
sys_init(&system);
for (u64 i = 0; i < ARRSIZE(words); ++i)
{
const char *in = words[i];
@@ -41,8 +42,9 @@ void sym_test(void)
TEST(strlen(in) == strlen(out), "%zu == %zu", strlen(in), strlen(out));
TEST(strncmp(in, out, strlen(in)) == 0, "`%s` == `%s`", in, out);
}
TEST_PASSED();
sys_free(&system);
TEST_PASSED();
}
void cons_test(void)
@@ -71,9 +73,8 @@ void cons_test(void)
TEST(strncmp(expected, got, size) == 0, "%s == %s", expected, got);
}
TEST_PASSED();
sys_free(&system);
TEST_PASSED();
}
const test_fn TESTS_LISP_API[] = {

View File

@@ -18,9 +18,8 @@ void symtable_test(void)
TEST(table.count == ARRSIZE(unique_words), "%lu == %lu", table.count,
ARRSIZE(unique_words));
TEST_PASSED();
sym_table_cleanup(&table);
TEST_PASSED();
}
const test_fn TESTS_SYMTABLE[] = {

View File

@@ -32,8 +32,8 @@ void vec_test_concat(void)
"%p@%lu == %p@%lu", (char *)vec_data(vec), vec->size, words_text,
strlen(words_text));
TEST_PASSED();
sys_free(&system);
TEST_PASSED();
}
void vec_test_substr(void)
@@ -65,8 +65,8 @@ void vec_test_substr(void)
substr.data, substr.size);
}
TEST_PASSED();
sys_free(&system);
TEST_PASSED();
}
const test_fn TESTS_VEC[] = {