From 05630cf10cc01a237131989248261149f03fc8ab Mon Sep 17 00:00:00 2001 From: Mitya Selivanov <0x7fffff@guattari.ru> Date: Sun, 7 Aug 2022 08:55:32 +0400 Subject: static array wrap, static string wrap --- source/test/unittests/string_ref.test.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 source/test/unittests/string_ref.test.c (limited to 'source/test/unittests/string_ref.test.c') diff --git a/source/test/unittests/string_ref.test.c b/source/test/unittests/string_ref.test.c new file mode 100644 index 0000000..b89459e --- /dev/null +++ b/source/test/unittests/string_ref.test.c @@ -0,0 +1,17 @@ +#include "../../kit/string_ref.h" + +#define KIT_TEST_FILE string_ref +#include "../../kit_test/test.h" + +TEST("static string wrap") { + SZ(ref, "foo bar"); + + REQUIRE(ref.size == 7); + REQUIRE(ref.values[0] == 'f'); + REQUIRE(ref.values[1] == 'o'); + REQUIRE(ref.values[2] == 'o'); + REQUIRE(ref.values[3] == ' '); + REQUIRE(ref.values[4] == 'b'); + REQUIRE(ref.values[5] == 'a'); + REQUIRE(ref.values[6] == 'r'); +} -- cgit v1.2.3