Port "test5" to littlecheck
Put the switch-related stuff in switch.fish, and the wildcard-related stuff in wildcard.fish.
This commit is contained in:
parent
e3ccc310e2
commit
109a8b07a7
@ -69,3 +69,34 @@ end
|
||||
#CHECKERR: fish: 'case' builtin not inside of switch block
|
||||
#CHECKERR: case a
|
||||
#CHECKERR: ^
|
||||
|
||||
set smurf green
|
||||
|
||||
switch $smurf;
|
||||
case "*ee*"
|
||||
echo Test 1 pass
|
||||
case "*"
|
||||
echo Test 1 fail
|
||||
end;
|
||||
#CHECK: Test 1 pass
|
||||
|
||||
switch $smurf
|
||||
case *ee*
|
||||
echo Test 2 fail
|
||||
case red green blue
|
||||
echo Test 2 pass
|
||||
case "*"
|
||||
echo Test 2 fail
|
||||
end
|
||||
#CHECKERR: {{.*}}switch.fish (line {{\d+}}): No matches for wildcard '*ee*'. See `help expand`.
|
||||
#CHECKERR: case *ee*
|
||||
#CHECKERR: ^
|
||||
#CHECK: Test 2 pass
|
||||
|
||||
switch $smurf
|
||||
case cyan magenta yellow
|
||||
echo Test 3 fail
|
||||
case "*"
|
||||
echo Test 3 pass
|
||||
end
|
||||
#CHECK: Test 3 pass
|
||||
|
@ -15,3 +15,17 @@ echo $dirs/*.txt
|
||||
|
||||
cd $oldpwd
|
||||
rm -Rf $dir
|
||||
|
||||
|
||||
# Verify that we can do wildcard expansion when we
|
||||
# don't have read access to some path components
|
||||
# See #2099
|
||||
set -l where ../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess
|
||||
mkdir -p $where
|
||||
chmod 300 (dirname $where) # no read permissions
|
||||
mkdir -p $where
|
||||
touch $where/alpha.txt $where/beta.txt $where/delta.txt
|
||||
echo $where/*
|
||||
#CHECK: ../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess/alpha.txt ../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess/beta.txt ../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess/delta.txt
|
||||
chmod 700 (dirname $where) # so we can delete it
|
||||
rm -rf ../test/temp/fish_wildcard_permissions_test
|
||||
|
@ -1,3 +0,0 @@
|
||||
fish: No matches for wildcard '*ee*'. See `help expand`.
|
||||
case *ee*
|
||||
^
|
@ -1,37 +0,0 @@
|
||||
|
||||
set smurf green
|
||||
|
||||
switch $smurf;
|
||||
case "*ee*"
|
||||
echo Test 1 pass
|
||||
case "*"
|
||||
echo Test 1 fail
|
||||
end;
|
||||
|
||||
switch $smurf
|
||||
case *ee*
|
||||
echo Test 2 fail
|
||||
case red green blue
|
||||
echo Test 2 pass
|
||||
case "*"
|
||||
echo Test 2 fail
|
||||
end
|
||||
|
||||
switch $smurf
|
||||
case cyan magenta yellow
|
||||
echo Test 3 fail
|
||||
case "*"
|
||||
echo Test 3 pass
|
||||
end
|
||||
|
||||
# Verify that we can do wildcard expansion when we
|
||||
# don't have read access to some path components
|
||||
# See #2099
|
||||
set -l where ../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess
|
||||
mkdir -p $where
|
||||
chmod 300 (dirname $where) # no read permissions
|
||||
mkdir -p $where
|
||||
touch $where/alpha.txt $where/beta.txt $where/delta.txt
|
||||
echo $where/*
|
||||
chmod 700 (dirname $where) # so we can delete it
|
||||
rm -rf ../test/temp/fish_wildcard_permissions_test
|
@ -1,4 +0,0 @@
|
||||
Test 1 pass
|
||||
Test 2 pass
|
||||
Test 3 pass
|
||||
../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess/alpha.txt ../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess/beta.txt ../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess/delta.txt
|
Loading…
x
Reference in New Issue
Block a user