mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
fix(exec/and or): was exiting too soon
This commit is contained in:
parent
7a5e838fcf
commit
f0f19c3c0a
2 changed files with 55 additions and 5 deletions
48
test.sh
48
test.sh
|
|
@ -1284,4 +1284,52 @@ hello
|
|||
hi
|
||||
EOF
|
||||
|
||||
when_run <<EOF "and withing subshell"
|
||||
touch hi hello
|
||||
(ls && ls)
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<EOF
|
||||
hello
|
||||
hi
|
||||
hello
|
||||
hi
|
||||
0
|
||||
EOF
|
||||
|
||||
when_run <<EOF "or withing subshell"
|
||||
touch hi hello
|
||||
(false || ls)
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<EOF
|
||||
hello
|
||||
hi
|
||||
0
|
||||
EOF
|
||||
|
||||
when_run <<EOF "and"
|
||||
touch hi hello
|
||||
ls && ls
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<EOF
|
||||
hello
|
||||
hi
|
||||
hello
|
||||
hi
|
||||
0
|
||||
EOF
|
||||
|
||||
when_run <<EOF "or"
|
||||
touch hi hello
|
||||
false || ls
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<EOF
|
||||
hello
|
||||
hi
|
||||
0
|
||||
EOF
|
||||
|
||||
finalize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue