From cef8a13cc249c5ebf985bfbf26e7c6a8011d7a1b Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 14 Jul 2018 14:18:25 +0200 Subject: [PATCH] Add a new test. --- tests/test-malgo.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test-malgo.c b/tests/test-malgo.c index ffd5aee8..af868303 100644 --- a/tests/test-malgo.c +++ b/tests/test-malgo.c @@ -242,6 +242,16 @@ static void test_string(void) assert (string_equal_str_p(s, " John")); assert (list_string_empty_p(l)); + string_set_str(s, "Hello,,John"); + algo_string_split(l, s, ','); + list_string_pop_back (&s, l); + assert (string_equal_str_p(s, "Hello")); + list_string_pop_back (&s, l); + assert (string_equal_str_p(s, "")); + list_string_pop_back (&s, l); + assert (string_equal_str_p(s, "John")); + assert (list_string_empty_p(l)); + list_string_push_back (l, STRING_CTE("John")); list_string_push_back (l, STRING_CTE("Who")); list_string_push_back (l, STRING_CTE("Is"));