aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/identifier.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/identifier.c b/test/identifier.c
new file mode 100644
index 0000000..94c57bb
--- /dev/null
+++ b/test/identifier.c
@@ -0,0 +1,11 @@
+
+#include "kpl_test.h"
+
+KPL_TEST(c_string_to_identifier) {
+ const char *string = "aA0_t4_12w0Z";
+ kpl_identifier identifier;
+ KPL_ASSERT(kpl_identifier_encode(&identifier, string, strlen(string)), "should encode");
+ char buffer[100] = {};
+ kpl_identifier_decode(&identifier, buffer);
+ KPL_ASSERT(strcmp(string, buffer) == 0, "should decode to same string");
+}