diff --git a/tests/word_splitting.c b/tests/word_splitting.c index 74786b2..94542de 100644 --- a/tests/word_splitting.c +++ b/tests/word_splitting.c @@ -6,7 +6,7 @@ /* By: khais +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/13 15:17:56 by khais #+# #+# */ -/* Updated: 2025/02/17 14:27:45 by khais ### ########.fr */ +/* Updated: 2025/02/17 14:37:17 by khais ### ########.fr */ /* */ /* ************************************************************************** */ @@ -100,6 +100,18 @@ static void test_wordsplit_mixed_double_in_single(void) wordlist_destroy(words); } +static void test_wordsplit_mixed_broken(void) +{ + t_wordlist *words; + + words = minishell_wordsplit("hello '\"mixed 'quotes'\"' there"); + assert_strequal("hello", wordlist_get(words, 0)->word); + assert_strequal("'\"mixed \'quotes'\"'", wordlist_get(words, 1)->word); + assert_strequal("there", wordlist_get(words, 2)->word); + assert(NULL == wordlist_get(words, 3)); + wordlist_destroy(words); +} + int main(void) { test_wordsplit_singleword(); test_wordsplit_singleword_with_blanks(); @@ -108,5 +120,6 @@ int main(void) { test_wordsplit_multiword_with_double_quotes(); test_wordsplit_mixed_single_in_double(); test_wordsplit_mixed_double_in_single(); + test_wordsplit_mixed_broken(); return (0); }