minishell/tests/test_cmdlist_use_after_free.c

29 lines
1.2 KiB
C
Raw Normal View History

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* test_cmdlist_use_after_free.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/03 11:40:37 by khais #+# #+# */
/* Updated: 2025/03/18 14:23:19 by khais ### ########.fr */
/* */
/* ************************************************************************** */
#include "../src/parser/wordsplit/wordsplit.h"
#include "../src/parser/command_list/command_list.h"
#include "libft.h"
#include <assert.h>
int main(void)
{
t_wordlist *words;
t_cmdlist *cmd;
cmd = NULL;
words = minishell_wordsplit("|");
cmd = cmdlist_from_wordlist(words);
wordlist_destroy(words);
assert(cmd == NULL);
return (0);
}