fix(exec/and or): was exiting too soon

This commit is contained in:
Khaïs COLIN 2025-04-25 17:51:54 +02:00
parent 7a5e838fcf
commit f0f19c3c0a
2 changed files with 55 additions and 5 deletions

48
test.sh
View file

@ -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