commit 266dac97fd1cbd2e14cf7a9ca0fda4e446c75e3c parent 775b775240d09fe665efaecf2432d590567e68ef Author: Bert Münnich <ber.t@posteo.de> Date: Sat, 28 Oct 2017 13:16:20 +0200 Add test for issue #40, exit status of -e with failed backquote or pipeline Diffstat:
M | trip.rc | | | 10 | ++++++++++ |
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/trip.rc b/trip.rc @@ -614,3 +614,13 @@ if (! ~ $X YYY) { A=``($nl){ $rc -c 'mkdir / >[2=1] | tr a-z A-Z' } B=``($nl){ $rc -c '>[2=1] mkdir / | tr a-z A-Z' } ~ $A $B || fail counter intuitive redirection bug, $A '!=' $B + +# test for github issue #40 +$rc -ec 'false | false' +if (~ $status 0) { + fail '"rc -e" exits with zero status when command in pipeline returns non-zero' +} +$rc -ec 'X=`{false}' +if (~ $status 0) { + fail '"rc -e" exits with zero status when backquote command returns non-zero' +}