From 0f9f00b54bc9ad6462d32be6be389f263d89b72f Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 9 Jun 2019 16:08:00 -0700 Subject: [PATCH] Add a test that verifies cd handling in pipes --- tests/cd.err | 3 +++ tests/cd.in | 19 +++++++++++++++++++ tests/cd.out | 3 +++ 3 files changed, 25 insertions(+) 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