From 1cb408c0e4f42c4b11e8e2f80374c26bb905ef22 Mon Sep 17 00:00:00 2001 From: Mosder Date: Tue, 18 Aug 2026 16:48:53 +0200 Subject: feat: added basic definitions and documentation + templates for implementation and tests for string slices --- tests/string_tests.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ tests/string_tests.h | 3 +++ tests/tests.c | 2 ++ 3 files changed, 51 insertions(+) create mode 100644 tests/string_tests.c create mode 100644 tests/string_tests.h (limited to 'tests') diff --git a/tests/string_tests.c b/tests/string_tests.c new file mode 100644 index 0000000..c1afd4f --- /dev/null +++ b/tests/string_tests.c @@ -0,0 +1,46 @@ +#include "string_tests.h" +#include "moslib/string.h" + +Test creating() { + test_assert(0, "TODO"); +} + +Test printing() { + test_assert(0, "TODO"); +} + +Test comparing() { + test_assert(0, "TODO"); +} + +Test splitting() { + test_assert(0, "TODO"); +} + +Test trimming() { + test_assert(0, "TODO"); +} + +Test prefix_suffix() { + test_assert(0, "TODO"); +} + +Test finding() { + test_assert(0, "TODO"); +} + +Test utf8_len_test() { + test_assert(0, "TODO"); +} + +void string_tests(Tester *tester) { + TestGroup *group = add_test_group(tester, "moslib/string.h"); + add_test(group, creating); + add_test(group, printing); + add_test(group, comparing); + add_test(group, splitting); + add_test(group, trimming); + add_test(group, prefix_suffix); + add_test(group, finding); + add_test(group, utf8_len_test); +} diff --git a/tests/string_tests.h b/tests/string_tests.h new file mode 100644 index 0000000..901c134 --- /dev/null +++ b/tests/string_tests.h @@ -0,0 +1,3 @@ +#include + +extern void string_tests(Tester *tester); diff --git a/tests/tests.c b/tests/tests.c index 7846d91..378daf6 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -2,12 +2,14 @@ #include "ds/array_tests.h" #include "mem/alloc_tests.h" +#include "string_tests.h" int main(void) { Tester *tester = new_tester(); mem_alloc_tests(tester); ds_array_tests(tester); + string_tests(tester); run_tests(tester); free_tester(tester); -- cgit v1.2.3