feat(redirections): allow a command composed only of redirections

This commit is contained in:
Khaïs COLIN 2025-04-28 14:20:13 +02:00
parent a9055b4c66
commit 92d647e33c
8 changed files with 58 additions and 17 deletions

37
test.sh
View file

@ -1404,4 +1404,41 @@ hello
hi
EOF
when_run <<EOF "output redirections with no associated cmd"
> outfile1 >> outfile2
ls
EOF
expecting <<EOF
outfile1
outfile2
EOF
when_run <<EOF "here-doc with no associated cmd"
<< eof
hello there
eof
echo \$?
EOF
expecting <<EOF
0
EOF
when_run <<EOF "input redirection with no associated cmd"
echo hello > infile
< infile
echo \$?
EOF
expecting <<EOF
0
EOF
when_run <<EOF "input redirection with no associated cmd where infile does not exist"
< infile
echo \$?
EOF
expecting <<EOF
minishell: infile: No such file or directory
1
EOF
finalize