2024-03-30 15:10:12 +00:00
|
|
|
# RUN: %fish %s | %filter-ctrlseqs
|
2020-01-22 19:46:02 +00:00
|
|
|
|
|
|
|
# Ensure that, if variable expansion results in multiple strings
|
|
|
|
# and one of them fails a glob, that we don't fail the entire expansion.
|
2020-01-30 16:34:48 +00:00
|
|
|
set -l oldpwd (pwd)
|
2020-01-22 19:46:02 +00:00
|
|
|
set dir (mktemp -d)
|
|
|
|
cd $dir
|
|
|
|
mkdir a
|
|
|
|
mkdir b
|
|
|
|
touch ./b/file.txt
|
|
|
|
|
|
|
|
set dirs ./a ./b
|
2020-09-26 09:52:00 +00:00
|
|
|
echo $dirs/*.txt # CHECK: ./b/file.txt
|
2024-01-09 18:06:33 +00:00
|
|
|
echo */foo/
|
|
|
|
# CHECKERR: checks/wildcard.fish (line {{\d+}}): No matches for wildcard '*/foo/'. See `help wildcards-globbing`.
|
|
|
|
# CHECKERR: echo */foo/
|
|
|
|
# CHECKERR: ^~~~~^
|
|
|
|
|
2020-01-22 19:46:02 +00:00
|
|
|
|
2020-01-30 16:34:48 +00:00
|
|
|
cd $oldpwd
|
2020-01-22 19:46:02 +00:00
|
|
|
rm -Rf $dir
|
2020-02-08 09:43:40 +00:00
|
|
|
|
|
|
|
|
2021-03-24 00:26:16 +00:00
|
|
|
# Verify that we can do wildcard expansion when we don't have read access to some path components.
|
2020-02-08 09:43:40 +00:00
|
|
|
# See #2099
|
2021-07-31 00:21:36 +00:00
|
|
|
set -l where ./fish_wildcard_permissions_test/noaccess/yesaccess
|
2020-02-08 09:43:40 +00:00
|
|
|
mkdir -p $where
|
|
|
|
chmod 300 (dirname $where) # no read permissions
|
|
|
|
mkdir -p $where
|
2020-02-14 17:44:54 +00:00
|
|
|
# "__env.fish" here to confirm ordering - #6593.
|
|
|
|
touch $where/alpha.txt $where/beta.txt $where/delta.txt $where/__env.fish
|
2021-07-31 00:21:36 +00:00
|
|
|
echo $where/*
|
|
|
|
#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
|
2020-02-08 09:43:40 +00:00
|
|
|
chmod 700 (dirname $where) # so we can delete it
|
2021-07-31 00:21:36 +00:00
|
|
|
rm -rf ./fish_wildcard_permissions_test
|