diff --git a/tests/checks/cd.fish b/tests/checks/cd.fish index e6cded924..e50587554 100644 --- a/tests/checks/cd.fish +++ b/tests/checks/cd.fish @@ -55,19 +55,21 @@ else end # CHECKERR: pwd: realpath failed: {{.+}} -mkdir $real/subdir -cd $link -test "$PWD" = "$link" || echo "Default cd should keep symlink:"\n "\$PWD: $PWD"\n "\$link: $link"\n -cd -P $link -test "$PWD" = "$real" || echo "cd -P should resolve symlink:"\n "\$PWD: $PWD"\n "\$real: $real"\n -cd $link/subdir -test "$PWD" = "$link/subdir" || echo "Logical cd should keep subdir symlink:"\n "\$PWD: $PWD"\n "\$link/subdir: $link/subdir"\n -cd -P .. -test "$PWD" = "$real" || echo "cd -P .. should use physical parent:"\n "\$PWD: $PWD"\n "\$real: $real"\n -cd $link/subdir -cd -L .. -test "$PWD" = "$link" || echo "cd -L .. should use logical parent:"\n "\$PWD: $PWD"\n "\$link: $link"\n -cd $base +if not set -q nosymlinks + mkdir $real/subdir + cd $link + test "$PWD" = "$link" || echo "Default cd should keep symlink:"\n "\$PWD: $PWD"\n "\$link: $link"\n + cd -P $link + test "$PWD" = "$real" || echo "cd -P should resolve symlink:"\n "\$PWD: $PWD"\n "\$real: $real"\n + cd $link/subdir + test "$PWD" = "$link/subdir" || echo "Logical cd should keep subdir symlink:"\n "\$PWD: $PWD"\n "\$link/subdir: $link/subdir"\n + cd -P .. + test "$PWD" = "$real" || echo "cd -P .. should use physical parent:"\n "\$PWD: $PWD"\n "\$real: $real"\n + cd $link/subdir + cd -L .. + test "$PWD" = "$link" || echo "cd -L .. should use logical parent:"\n "\$PWD: $PWD"\n "\$link: $link"\n + cd $base +end # Create a symlink and verify logical completion. # create directory $base/through/the/looking/glass