Port some small tests to littlecheck

This commit is contained in:
Fabian Homborg 2020-02-08 10:38:11 +01:00
parent 8bd97d087d
commit bf7629462a
9 changed files with 19 additions and 20 deletions

13
tests/checks/exec.fish Normal file
View File

@ -0,0 +1,13 @@
#RUN: %fish %s
exec cat < nosuchfile
#CHECKERR: warning: An error occurred while redirecting file 'nosuchfile'
#CHECKERR: open: No such file or directory
echo "failed: $status"
#CHECK: failed: 1
not exec cat < nosuchfile
#CHECKERR: warning: An error occurred while redirecting file 'nosuchfile'
#CHECKERR: open: No such file or directory
echo "neg failed: $status"
#CHECK: neg failed: 0
exec cat < /dev/null
echo "not reached"

View File

@ -11,3 +11,9 @@ printf '<%s>\n' ($fish -c 'if $f[a]; end' 2>&1)
# CHECK: <fish: Invalid index value>
# CHECK: <if $f[a]; end>
# CHECK: < ^>
set a A
set aa AA
set aaa AAA
echo {$aa}a{1,2,3}(for a in 1 2 3; echo $a; end)
#CHECK: AAa11 AAa21 AAa31 AAa12 AAa22 AAa32 AAa13 AAa23 AAa33

View File

View File

@ -1,6 +0,0 @@
#Tests complex parameter expansions
set a A
set aa AA
set aaa AAA
echo {$aa}a{1,2,3}(for a in 1 2 3; echo $a; end)

View File

@ -1 +0,0 @@
AAa11 AAa21 AAa31 AAa12 AAa22 AAa32 AAa13 AAa23 AAa33

View File

@ -1,4 +0,0 @@
warning: An error occurred while redirecting file 'nosuchfile'
open: No such file or directory
warning: An error occurred while redirecting file 'nosuchfile'
open: No such file or directory

View File

@ -1,6 +0,0 @@
exec cat < nosuchfile
echo "failed: $status"
not exec cat < nosuchfile
echo "neg failed: $status"
exec cat < /dev/null
echo "not reached"

View File

@ -1,2 +0,0 @@
failed: 1
neg failed: 0

View File

@ -1 +0,0 @@
0