diff options
| author | Mistivia <i@mistivia.com> | 2025-06-06 12:58:14 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-06-06 12:58:14 +0800 |
| commit | 1fad3a10fe4743d69342de294cc65bfe66e32bc9 (patch) | |
| tree | d91be066e44fe7af1eeece0f1b081463bc64dfc7 /tests/test_str.c | |
| parent | 4779050053cb5f73b54ff936c6393e82ffe5605c (diff) | |
fix leak and hashtable bug
Diffstat (limited to 'tests/test_str.c')
| -rw-r--r-- | tests/test_str.c | 7 |
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() { |
