Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

pwd -r vs. pwd test failure



I got a test failure in B13 today:

Running test: whence symlink resolution
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.360386/ztst.in, output: /tmp/zsh.ztst.360386/ztst.out,
error: /tmp/zsh.ztst.360386/ztst.terr
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
/opt/build/zsh-2020-03-26/Test/whence.tmp/step1 ->
/SSD-2/opt/build/zsh-2020-03-26/Test/whence.tmp/step1 -> /SSD-2/opt/
build/zsh-2020-03-26/Test/whence.tmp/step2 ->
/SSD-2/opt/build/zsh-2020-03-26/Test/whence.tmp/step3 -> /SSD-2/opt/build
/zsh-2020-03-26/Test/whence.tmp/real
/opt/build/zsh-2020-03-26/Test/whence.tmp/step1 ->
/SSD-2/opt/build/zsh-2020-03-26/Test/whence.tmp/real
ZTST_test: and standard error:

--- /tmp/zsh.ztst.360386/ztst.out       2020-03-26 08:04:38.543366746 -0400
+++ /tmp/zsh.ztst.360386/ztst.tout      2020-03-26 08:04:38.543366746 -0400
@@ -1,2 +1,2 @@
-/opt/build/zsh-2020-03-26/Test/whence.tmp/step1 ->
/opt/build/zsh-2020-03-26/Test/whence.tmp/step2 ->
/opt/build/zsh-2020-03-26/Test/whence.tmp/step3 ->
/opt/build/zsh-2020-03-26/Test/whence.tmp/real
-/opt/build/zsh-2020-03-26/Test/whence.tmp/step1 ->
/opt/build/zsh-2020-03-26/Test/whence.tmp/real
+/opt/build/zsh-2020-03-26/Test/whence.tmp/step1 ->
/SSD-2/opt/build/zsh-2020-03-26/Test/whence.tmp/step1 ->
/SSD-2/opt/build/zsh-2020-03-26/Test/whence.tmp/step2 ->
/SSD-2/opt/build/zsh-2020-03-26/Test/whence.tmp/step3 ->
/SSD-2/opt/build/zsh-2020-03-26/Test/whence.tmp/real
+/opt/build/zsh-2020-03-26/Test/whence.tmp/step1 ->
/SSD-2/opt/build/zsh-2020-03-26/Test/whence.tmp/real
Test ../../../src/zsh-2020-03-26/Test/B13whence.ztst failed: output differs
from expected as shown above for:
  (
    path=( $PWD/whence.tmp $path )
    whence -S step1
    whence -s step1
  )
Was testing: whence symlink resolution
../../../src/zsh-2020-03-26/Test/B13whence.ztst: test failed.

Looking at the diff, I realized that my build directory is under a symlink;
/opt -> /SSD-2/opt. The test uses $PWD, which resolves to
/opt/build/zsh-2020-03-26, but pwd -r correct identifies the path as
/SSD-2/opt/build/zsh-2020-03-26; sure enough, if I run the test from
/SSD-2/opt/build/zsh-2020-03-26, the test passes. Is the right thing to fix
the test, or should $PWD track realpath?

  - Vin


Messages sorted by: Reverse Date, Date, Thread, Author