aboutsummaryrefslogtreecommitdiff
path: root/test/identifier.c
blob: 94c57bbedd97df7e30ea7bc9f4466a086521dc2d (plain)
1
2
3
4
5
6
7
8
9
10
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");
}