diff --git a/tests/cd.err b/tests/cd.err index 331132ff0..ebc6ea138 100644 --- a/tests/cd.err +++ b/tests/cd.err @@ -13,3 +13,6 @@ #################### # on-variable PWD + +#################### +# cd concurrency diff --git a/tests/cd.in b/tests/cd.in index 3ac2c9d02..d52c2e46d 100644 --- a/tests/cd.in +++ b/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 diff --git a/tests/cd.out b/tests/cd.out index b47e701f4..d6098ed9d 100644 --- a/tests/cd.out +++ b/tests/cd.out @@ -34,3 +34,6 @@ No crash with ./ CDPATH #################### # on-variable PWD Changed to / + +#################### +# cd concurrency