From 5a26e1f481fe85f08093a414e27c1056b85c6715 Mon Sep 17 00:00:00 2001 From: Clement Sibille Date: Thu, 9 May 2024 08:58:14 +0900 Subject: Initial commit --- tests/string.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/string.c (limited to 'tests/string.c') diff --git a/tests/string.c b/tests/string.c new file mode 100644 index 0000000..e3d68f4 --- /dev/null +++ b/tests/string.c @@ -0,0 +1,14 @@ +#include "lisiblestd/memory.h" +#include "test.h" +#include + +void t_String_from_str(void) { + String string; + String_from_str(&system_allocator, &string, "Some string"); + T_ASSERT(strncmp(string.value, "Some string", 11)); + T_ASSERT_EQ(string.length, 11); + + String_destroy(&system_allocator, &string); +} + +TEST_SUITE(TEST(t_String_from_str)) -- cgit v1.2.3