diff --git a/tests/parse_command_lists.c b/tests/parse_command_lists.c index e83065e..c6554ee 100644 --- a/tests/parse_command_lists.c +++ b/tests/parse_command_lists.c @@ -6,7 +6,7 @@ /* By: khais +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/24 17:40:48 by khais #+# #+# */ -/* Updated: 2025/03/04 15:13:21 by khais ### ########.fr */ +/* Updated: 2025/03/04 15:16:00 by khais ### ########.fr */ /* */ /* ************************************************************************** */ @@ -176,6 +176,17 @@ static void test_parse_command_list_invalid_pipeline(void) cmdlist_destroy(cmd); } +static void test_parse_command_list_simple_command(void) +{ + ft_dprintf(STDERR_FILENO, "==> %s <==\n", __FUNCTION__); + t_cmdlist *cmd = parse_command_list("echo this"); + assert(cmd != NULL); + assert_pipelineequal("echo this", cmd, 0); + assert(cmd->operators[0] == OP_END); + assert(cmd->num_pipelines == 1); + cmdlist_destroy(cmd); +} + int main(void) { test_parse_command_list_empty(); @@ -194,5 +205,7 @@ int main(void) do_leak_check(); test_parse_command_list_invalid_pipeline(); do_leak_check(); + test_parse_command_list_simple_command(); + do_leak_check(); return (0); }