summaryrefslogtreecommitdiff
path: root/source/tests/string_ref.test.c
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-02 20:59:29 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-02 20:59:29 +0200
commit835e1fcd131c63ee2b3b647e327b33a3bfb369e3 (patch)
tree9d6fb42d6296a7bbec4a6ea58358c0fdb5de7e05 /source/tests/string_ref.test.c
parent34ba87d8c8cfef5ed249b34bd2d2b7e41a34d2f7 (diff)
downloadkit-835e1fcd131c63ee2b3b647e327b33a3bfb369e3.zip
[Linux] Change build system; Remove CMake
Diffstat (limited to 'source/tests/string_ref.test.c')
-rw-r--r--source/tests/string_ref.test.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/tests/string_ref.test.c b/source/tests/string_ref.test.c
new file mode 100644
index 0000000..2891f16
--- /dev/null
+++ b/source/tests/string_ref.test.c
@@ -0,0 +1,23 @@
+#include "../kit/string_ref.h"
+
+#define KIT_TEST_FILE string_ref
+#include "../kit_test/test.h"
+
+TEST("static string wrap") {
+ str_t ref = SZ("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');
+}
+
+TEST("string literal") {
+ str_t foo = SZ("foo");
+ str_t bar = foo;
+ (void) bar;
+}