/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* test_cmdgroup_parsing.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: khais +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/03/11 15:07:23 by khais #+# #+# */ /* Updated: 2025/03/11 15:20:17 by khais ### ########.fr */ /* */ /* ************************************************************************** */ #include "testutil.h" #include #include "libft.h" #include "../src/parser/cmdgroup/cmdgroup.h" #include "../src/parser/wordsplit/wordsplit.h" static t_cmdgroup *parse_cmdgroup(char *input) { ft_dprintf(STDERR_FILENO, "Now checking command group with input [%s]\n", input); t_wordlist *words = minishell_wordsplit(input); t_cmdgroup *cmd = cmdgroup_from_wordlist(words); wordlist_destroy(words); return (cmd); } static void test_cmdgroup_parsing_empty(void) { t_cmdgroup *cmd; // arange ft_dprintf(STDERR_FILENO, "==> %s <==\n", __FUNCTION__); cmd = parse_cmdgroup(""); // assert assert(NULL == cmd); // cleanup cmdgroup_destroy(cmd); do_leak_check(); } int main(void) { test_cmdgroup_parsing_empty(); return (0); }