fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
4ffa06fb7
master
1# RUN: %fish %s 2 3# Ensure that, if variable expansion results in multiple strings 4# and one of them fails a glob, that we don't fail the entire expansion. 5set -l oldpwd( pwd ) 6set dir( mktemp -d) 7cd $dir 8mkdir a 9mkdir b 10touch ./b/file.txt 11 12set dirs ./a ./b 13echo $dirs /*.txt# CHECK: ./b/file.txt 14echo */foo/ 15# CHECKERR: {{.*}}checks/wildcard.fish (line {{\d+}}): No matches for wildcard '*/foo/'. See `help language#wildcards-globbing`. 16# CHECKERR: echo */foo/ 17# CHECKERR: ^~~~~^ 18 19 20cd $oldpwd 21rm -Rf$dir 22 23 24# Verify that we can do wildcard expansion when we don't have read access to some path components. 25# See #2099 26set -l where ./fish_wildcard_permissions_test/noaccess/yesaccess 27mkdir -p$where 28chmod 300 ( dirname $where ) # no read permissions 29mkdir -p$where 30# "__env.fish" here to confirm ordering - #6593. 31touch $where /alpha.txt$where /beta.txt$where /delta.txt$where /__env.fish 32echo $where /* 33#CHECK: ./fish_wildcard_permissions_test/noaccess/yesaccess/__env.fish ./fish_wildcard_permissions_test/noaccess/yesaccess/alpha.txt ./fish_wildcard_permissions_test/noaccess/yesaccess/beta.txt ./fish_wildcard_permissions_test/noaccess/yesaccess/delta.txt 34chmod 700 ( dirname $where ) # so we can delete it 35rm -rf ./fish_wildcard_permissions_test