mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
pipeline parse: reject hanging pipe at end
This rejects commands such as echo hello | cat -e | I also updated the doc this time
This commit is contained in:
parent
8606774781
commit
4b403c4bf3
2 changed files with 28 additions and 9 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/21 13:13:58 by khais #+# #+# */
|
||||
/* Updated: 2025/02/24 15:19:39 by khais ### ########.fr */
|
||||
/* Updated: 2025/02/24 17:22:54 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -117,6 +117,13 @@ static void test_parse_pipeline_pipe_at_start_rejected(void)
|
|||
assert(ft_errno_get() == FT_EUNEXPECTED_PIPE);
|
||||
}
|
||||
|
||||
static void test_parse_pipeline_pipe_at_end_rejected(void)
|
||||
{
|
||||
ft_errno(FT_ESUCCESS);
|
||||
assert(parse_pipeline("echo hello | tee output.txt |") == NULL);
|
||||
assert(ft_errno_get() == FT_EUNEXPECTED_PIPE);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
test_parse_empty_pipeline();
|
||||
|
|
@ -127,5 +134,6 @@ int main(void)
|
|||
test_parse_pipeline_double_pipe_rejected();
|
||||
test_parse_pipeline_triple_pipe_rejected();
|
||||
test_parse_pipeline_pipe_at_start_rejected();
|
||||
test_parse_pipeline_pipe_at_end_rejected();
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue