mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
token_type: add field with no logic for populating it
This commit is contained in:
parent
5716c4b3dc
commit
18014cda98
9 changed files with 39 additions and 32 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/07 11:43:32 by khais #+# #+# */
|
||||
/* Updated: 2025/03/28 19:05:55 by khais ### ########.fr */
|
||||
/* Updated: 2025/04/08 16:34:50 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -45,10 +45,10 @@ static void test_here_doc_invalid_args(void)
|
|||
ft_dprintf(STDERR_FILENO, "==> %s <==\n", __FUNCTION__);
|
||||
ft_errno(FT_ESUCCESS);
|
||||
assert(-1 == here_doc(NULL, 0, NULL));
|
||||
marker = worddesc_create(NULL, 0, NULL);
|
||||
marker = worddesc_create(NULL, 0, NULL, WORD_TOKEN);
|
||||
assert(-1 == here_doc(marker, 0, NULL));
|
||||
worddesc_destroy(marker);
|
||||
marker = worddesc_create(ft_strdup("EOF"), 0, NULL);
|
||||
marker = worddesc_create(ft_strdup("EOF"), 0, NULL, WORD_TOKEN);
|
||||
assert(-1 == here_doc(marker, -1, NULL));
|
||||
worddesc_destroy(marker);
|
||||
do_leak_check();
|
||||
|
|
@ -62,7 +62,7 @@ static void test_here_doc_only_end_marker(void)
|
|||
|
||||
ft_dprintf(STDERR_FILENO, "==> %s <==\n", __FUNCTION__);
|
||||
ft_errno(FT_ESUCCESS);
|
||||
marker = worddesc_create(ft_strdup("EOF"), 0, NULL);
|
||||
marker = worddesc_create(ft_strdup("EOF"), 0, NULL, WORD_TOKEN);
|
||||
infile = open("./here_doc_only_eof.input", O_RDONLY);
|
||||
result = here_doc(marker, infile, NULL);
|
||||
close(infile);
|
||||
|
|
@ -81,7 +81,7 @@ static void test_here_doc_input_plus_end_marker(void)
|
|||
|
||||
ft_dprintf(STDERR_FILENO, "==> %s <==\n", __FUNCTION__);
|
||||
ft_errno(FT_ESUCCESS);
|
||||
marker = worddesc_create(ft_strdup("EOF"), 0, NULL);
|
||||
marker = worddesc_create(ft_strdup("EOF"), 0, NULL, WORD_TOKEN);
|
||||
infile = open("./here_doc_input_plus_eof.input", O_RDONLY);
|
||||
result = here_doc(marker, infile, NULL);
|
||||
close(infile);
|
||||
|
|
@ -99,7 +99,7 @@ static void test_here_doc_input_no_end_marker(void)
|
|||
int result;
|
||||
|
||||
ft_dprintf(STDERR_FILENO, "==> %s <==\n", __FUNCTION__);
|
||||
marker = worddesc_create(ft_strdup("EOF"), 0, NULL);
|
||||
marker = worddesc_create(ft_strdup("EOF"), 0, NULL, WORD_TOKEN);
|
||||
infile = open("./here_doc_input_no_eof.input", O_RDONLY);
|
||||
result = here_doc(marker, infile, NULL);
|
||||
close(infile);
|
||||
|
|
@ -121,7 +121,7 @@ static void test_here_doc_with_expansion(void)
|
|||
app.env = env_set_entry(&app.env, ft_strdup("USER"), ft_strdup("kcolin"));
|
||||
ft_dprintf(STDERR_FILENO, "==> %s <==\n", __FUNCTION__);
|
||||
ft_errno(FT_ESUCCESS);
|
||||
marker = worddesc_create(ft_strdup("EOF"), 0, NULL);
|
||||
marker = worddesc_create(ft_strdup("EOF"), 0, NULL, WORD_TOKEN);
|
||||
infile = open("./here_doc_with_expansion.input", O_RDONLY);
|
||||
result = here_doc(marker, infile, &app);
|
||||
close(infile);
|
||||
|
|
@ -144,7 +144,7 @@ static void test_here_doc_with_no_expansion(void)
|
|||
ft_bzero(&app, sizeof(t_minishell));
|
||||
app.env = env_set_entry(&app.env, ft_strdup("USER"), ft_strdup("kcolin"));
|
||||
ft_dprintf(STDERR_FILENO, "==> %s <==\n", __FUNCTION__);
|
||||
marker = worddesc_create(ft_strdup("EOF"), W_QUOTED, NULL);
|
||||
marker = worddesc_create(ft_strdup("EOF"), W_QUOTED, NULL, WORD_TOKEN);
|
||||
infile = open("./here_doc_with_expansion.input", O_RDONLY);
|
||||
result = here_doc(marker, infile, &app);
|
||||
close(infile);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue