#define DEBUG #include #include #include #include #include "../include/sv.h" int main(void){ const char *s = "Hello World! "; const char *s2 = "Hello World!"; SV sv = sv_str(s); assert(sv.buf != NULL); assert(strlen(s) == sv.len); assert( memcmp(sv.buf, s, strlen(s)) == 0); SV sv2 = sv_trim_right(sv); assert(sv2.len == strlen(s2)); assert(memcmp(s2, sv2.buf, sv2.len) == 0); assert(sv2.len != strlen(s)); return EXIT_SUCCESS; }