Expansion: fix but still a problem matching '.'

Problem in the coherence of behaviour regarding ownership with star expansion
fixed.
This commit is contained in:
Jérôme Guélen 2025-03-20 14:47:53 +01:00
parent da06c0d4e0
commit b58848e091
No known key found for this signature in database
4 changed files with 43 additions and 7 deletions

View file

@ -6,7 +6,7 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/19 17:52/50 by khais #+# #+# */
/* Updated: 2025/03/20 10:36:23 by jguelen ### ########.fr */
/* Updated: 2025/03/20 14:47:23 by jguelen ### ########.fr */
/* */
/* ************************************************************************** */
@ -167,7 +167,7 @@ static void test_filename_star_expansion(void)
//test ., .. and .plop
filepattern = create_single_word(".*");
expanded = expand_star(filepattern);
//assert(wordlist_size(expanded) == 3);
assert(wordlist_size(expanded) == 3);
//assert_strequal(".", expanded->word->word);
//assert_strequal("..", expanded->next->word->word);
//assert_strequal(".plop", expanded->next->next->word->word);
@ -176,8 +176,9 @@ static void test_filename_star_expansion(void)
//test zero result
filepattern = create_single_word("e*x***p*b");
expanded = expand_star(filepattern);
assert(expanded);
assert_strequal(filepattern->word, expanded->word->word);
worddesc_destroy(filepattern);
assert(!expanded);
wordlist_destroy(expanded);
do_leak_check();
}