2020-02-08 09:38:11 +00:00
|
|
|
#RUN: %fish %s
|
2020-03-09 18:36:12 +00:00
|
|
|
exec cat <nosuchfile
|
2020-02-08 09:38:11 +00:00
|
|
|
#CHECKERR: warning: An error occurred while redirecting file 'nosuchfile'
|
|
|
|
#CHECKERR: open: No such file or directory
|
|
|
|
echo "failed: $status"
|
|
|
|
#CHECK: failed: 1
|
2020-03-09 18:36:12 +00:00
|
|
|
not exec cat <nosuchfile
|
2020-02-08 09:38:11 +00:00
|
|
|
#CHECKERR: warning: An error occurred while redirecting file 'nosuchfile'
|
|
|
|
#CHECKERR: open: No such file or directory
|
|
|
|
echo "neg failed: $status"
|
|
|
|
#CHECK: neg failed: 0
|
2020-09-25 14:44:02 +00:00
|
|
|
|
|
|
|
set -l f (mktemp)
|
|
|
|
echo "#!/bin/sh"\r\n"echo foo" > $f
|
|
|
|
chmod +x $f
|
2020-09-26 05:22:17 +00:00
|
|
|
# Cheesy sleep to avoid "text file is busy"
|
|
|
|
sleep 0.2
|
2020-09-25 14:44:02 +00:00
|
|
|
$f
|
|
|
|
#CHECKERR: Failed to execute process '{{.*}}'. Reason:
|
|
|
|
#CHECKERR: The file uses windows line endings (\r\n). Run dos2unix or similar to fix it.
|
|
|
|
|
|
|
|
# This needs to be last, because it actually runs exec.
|
2020-03-09 18:36:12 +00:00
|
|
|
exec cat </dev/null
|
2020-02-08 09:38:11 +00:00
|
|
|
echo "not reached"
|
2020-09-25 14:44:02 +00:00
|
|
|
|