Expansion: fixed the algo for star expansion.

This commit is contained in:
Jérôme Guélen 2025-03-20 16:57:05 +01:00
parent 41c9548934
commit 00f27ae05c
No known key found for this signature in database
3 changed files with 14 additions and 59 deletions

View file

@ -6,7 +6,7 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/20 14:51/50 by khais #+# #+# */
/* Updated: 2025/03/20 14:51:50 by khais ### ########.fr */
/* Updated: 2025/03/20 16:22:15 by jguelen ### ########.fr */
/* */
/* ************************************************************************** */
@ -170,9 +170,9 @@ static void test_filename_star_expansion(void)
expanded = expand_star(filepattern);
wordlist_debug(expanded);
assert(wordlist_size(expanded) == 3);
//assert_strequal(".", expanded->word->word);
//assert_strequal("..", expanded->next->word->word);
//assert_strequal(".plop", expanded->next->next->word->word);
assert_strequal(".", expanded->word->word);
assert_strequal("..", expanded->next->word->word);
assert_strequal(".plop", expanded->next->next->word->word);
worddesc_destroy(filepattern);
wordlist_destroy(expanded);
//test zero result