Commit e1097fdd authored by Pontus Freyhult's avatar Pontus Freyhult
Browse files

Added tests for lsh_string_colonize.

Rev: src/testsuite/string-test.c:1.2
parent f8d92255
......@@ -21,5 +21,29 @@ test_main(void)
p = lsh_get_cstring(s);
ASSERT(p && !*p);
s = S("colonize this");
s = lsh_string_colonize(s, 2, 1);
p = lsh_get_cstring(s);
ASSERT(p && !strcmp(p, "co:lo:ni:ze: t:hi:s")) ;
s = S("fo");
s = lsh_string_colonize(s, 2, 1);
p = lsh_get_cstring(s);
ASSERT(p && !strcmp(p, "fo")) ;
s = S("");
s = lsh_string_colonize(s, 1, 1);
p = lsh_get_cstring(s);
ASSERT(p && !*p) ;
s = S("colonize this");
s = lsh_string_colonize(s, 1, 1);
p = lsh_get_cstring(s);
ASSERT(p && !strcmp(p, "c:o:l:o:n:i:z:e: :t:h:i:s")) ;
SUCCESS();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment