diff --git a/tests/word_splitting.c b/tests/word_splitting.c index ea652e5..2b64d7b 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/03/06 15:46:23 by khais ### ########.fr */ +/* Updated: 2025/03/06 15:50:01 by khais ### ########.fr */ /* */ /* ************************************************************************** */ @@ -101,8 +101,11 @@ static void test_wordsplit_mixed_single_in_double(void) words = minishell_wordsplit("hello \"mixed ' \tquotes \t'\" there"); assert_strequal("hello", wordlist_get(words, 0)->word); + assert_strequal(" ", wordlist_get(words, 0)->marker); assert_strequal("\"mixed ' \tquotes \t'\"", wordlist_get(words, 1)->word); + assert_strequal(" \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\" ", wordlist_get(words, 1)->marker); assert_strequal("there", wordlist_get(words, 2)->word); + assert_strequal(" ", wordlist_get(words, 2)->marker); assert(NULL == wordlist_get(words, 3)); wordlist_destroy(words); } @@ -113,8 +116,11 @@ static void test_wordsplit_mixed_double_in_single(void) words = minishell_wordsplit("hello 'mixed \" quotes \"' there"); assert_strequal("hello", wordlist_get(words, 0)->word); + assert_strequal(" ", wordlist_get(words, 0)->marker); assert_strequal("'mixed \" quotes \"'", wordlist_get(words, 1)->word); + assert_strequal(" '''''''''''''''' ", wordlist_get(words, 1)->marker); assert_strequal("there", wordlist_get(words, 2)->word); + assert_strequal(" ", wordlist_get(words, 2)->marker); assert(NULL == wordlist_get(words, 3)); wordlist_destroy(words); } @@ -125,8 +131,11 @@ static void test_wordsplit_mixed_broken(void) 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(" ", wordlist_get(words, 0)->marker); + assert_strequal("'\"mixed 'quotes'\"'", wordlist_get(words, 1)->word); + assert_strequal(" ''''''' ' ", wordlist_get(words, 1)->marker); assert_strequal("there", wordlist_get(words, 2)->word); + assert_strequal(" ", wordlist_get(words, 2)->marker); assert(NULL == wordlist_get(words, 3)); wordlist_destroy(words); } @@ -147,6 +156,8 @@ static void test_wordsplit_unclosed_double(void) assert(words == NULL); } +// kco work marker + static void test_wordsplit_operator_word(void) { t_wordlist *words;