aboutsummaryrefslogtreecommitdiff
path: root/tests/test_str.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_str.c')
-rw-r--r--tests/test_str.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_str.c b/tests/test_str.c
index 85e4f31..bde028e 100644
--- a/tests/test_str.c
+++ b/tests/test_str.c
@@ -61,24 +61,31 @@ void test_str_strip() {
s = str_strip("hello ");
assert(strcmp(s, "hello") == 0);
+ free(s);
s = str_strip("hello");
assert(strcmp(s, "hello") == 0);
+ free(s);
s = str_strip("\nhello ");
assert(strcmp(s, "hello") == 0);
+ free(s);
s = str_strip("\nhello");
assert(strcmp(s, "hello") == 0);
+ free(s);
s = str_strip("");
assert(strcmp(s, "") == 0);
+ free(s);
s = str_strip("\n\t ");
assert(strcmp(s, "") == 0);
+ free(s);
s = str_strip(" ");
assert(strcmp(s, "") == 0);
+ free(s);
}
void test_str_bulider() {