mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
Add a test that verifies cd handling in pipes
This commit is contained in:
parent
1baa479bbf
commit
0f9f00b54b
3 changed files with 25 additions and 0 deletions
|
@ -13,3 +13,6 @@
|
|||
|
||||
####################
|
||||
# on-variable PWD
|
||||
|
||||
####################
|
||||
# cd concurrency
|
||||
|
|
19
tests/cd.in
19
tests/cd.in
|
@ -86,3 +86,22 @@ function __fish_test_changed_pwd --on-variable PWD
|
|||
echo "Changed to $PWD"
|
||||
end
|
||||
cd /
|
||||
functions --erase __fish_test_changed_pwd
|
||||
|
||||
logmsg cd concurrency
|
||||
# Verify that cds don't stomp on each other.
|
||||
function __fish_test_thrash_cd
|
||||
set -l dir (mktemp -d)
|
||||
cd $dir
|
||||
for i in (seq 50)
|
||||
test (/bin/pwd) = $dir
|
||||
and test $PWD = $dir
|
||||
or echo "cd test failed" 1>&2
|
||||
sleep .002
|
||||
end
|
||||
end
|
||||
__fish_test_thrash_cd |
|
||||
__fish_test_thrash_cd |
|
||||
__fish_test_thrash_cd |
|
||||
__fish_test_thrash_cd |
|
||||
__fish_test_thrash_cd
|
||||
|
|
|
@ -34,3 +34,6 @@ No crash with ./ CDPATH
|
|||
####################
|
||||
# on-variable PWD
|
||||
Changed to /
|
||||
|
||||
####################
|
||||
# cd concurrency
|
||||
|
|
Loading…
Reference in a new issue