Skip to content

Commit

Permalink
Add test for str_array_strip
Browse files Browse the repository at this point in the history
  • Loading branch information
lchsk committed Aug 13, 2016
1 parent 5e2b11a commit fd2005e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/str_array.c
Expand Up @@ -86,3 +86,19 @@ Test(str_array, several)

str_array_free(result);
}

Test(str_array, strip)
{
char *test = strdup("a: b: c: ");
str_array_t *result = str_array_new(test, ":");

str_array_strip(result);

cr_assert_eq(result->length, 4);
cr_assert_str_eq(result->data[0], "a");
cr_assert_str_eq(result->data[1], "b");
cr_assert_str_eq(result->data[2], "c");
cr_assert_str_eq(result->data[3], "");

str_array_free(result);
}

0 comments on commit fd2005e

Please sign in to comment.