Add a test that verifies cd handling in pipes

This commit is contained in:
ridiculousfish 2019-06-09 16:08:00 -07:00
parent 1baa479bbf
commit 0f9f00b54b
3 changed files with 25 additions and 0 deletions

View file

@ -13,3 +13,6 @@
####################
# on-variable PWD
####################
# cd concurrency

View file

@ -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

View file

@ -34,3 +34,6 @@ No crash with ./ CDPATH
####################
# on-variable PWD
Changed to /
####################
# cd concurrency