zsh/Test/B13whence.ztst

32 lines
586 B
Plaintext

%prep
mkdir whence.tmp
pushd whence.tmp
ln -s real step3
ln -s step3 step2
ln -s step2 step1
ln -s loop loop
ln -s flip flop
ln -s flop flip
touch real
chmod +x real
prefix=$PWD
popd
%test
(
path=( $PWD/whence.tmp $path )
whence -S step1
whence -s step1
)
0q:whence symlink resolution
>$prefix/step1 -> $prefix/step2 -> $prefix/step3 -> $prefix/real
>$prefix/step1 -> $prefix/real
(
path=( $PWD/whence.tmp $path )
whence -S flip || whence -S loop || whence -s flip || whence -s loop
)
1:whence deals with symlink loops gracefully