mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
37 lines
1.4 KiB
C
37 lines
1.4 KiB
C
|
|
/* ************************************************************************** */
|
||
|
|
/* */
|
||
|
|
/* ::: :::::::: */
|
||
|
|
/* parse_command_lists.c :+: :+: :+: */
|
||
|
|
/* +:+ +:+ +:+ */
|
||
|
|
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||
|
|
/* +#+#+#+#+#+ +#+ */
|
||
|
|
/* Created: 2025/02/24 17:40:48 by khais #+# #+# */
|
||
|
|
/* Updated: 2025/02/24 17:47:39 by khais ### ########.fr */
|
||
|
|
/* */
|
||
|
|
/* ************************************************************************** */
|
||
|
|
|
||
|
|
#include "../src/parser/command_list/command_list.h"
|
||
|
|
#include "../src/parser/wordsplit/wordsplit.h"
|
||
|
|
#include <assert.h>
|
||
|
|
|
||
|
|
static t_command_list *parse_command_list(char *input)
|
||
|
|
{
|
||
|
|
t_wordlist *words = minishell_wordsplit(input);
|
||
|
|
t_command_list *cmd = command_list_from_wordlist(words);
|
||
|
|
return (cmd);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
static void test_parse_command_list_empty(void)
|
||
|
|
{
|
||
|
|
t_command_list *cmd = parse_command_list("");
|
||
|
|
assert(cmd == NULL);
|
||
|
|
command_list_destroy(cmd);
|
||
|
|
}
|
||
|
|
|
||
|
|
int main(void)
|
||
|
|
{
|
||
|
|
test_parse_command_list_empty();
|
||
|
|
return (0);
|
||
|
|
}
|