From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RDNS_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 Received: (qmail 22034 invoked from network); 26 Mar 2020 22:03:43 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from unknown (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTP; 26 Mar 2020 22:03:43 -0000 Received: (qmail 14646 invoked by alias); 26 Mar 2020 22:03:33 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45636 Received: (qmail 18255 invoked by uid 1010); 26 Mar 2020 22:03:33 -0000 X-Qmail-Scanner-Diagnostics: from out3-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25758. spamassassin: 3.4.2. Clear:RC:0(66.111.4.27):SA:0(-2.6/5.0):. Processed in 3.77389 secs); 26 Mar 2020 22:03:33 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudehjedgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkjghfofggtgfgsehtqh dttdertddvnecuhfhrohhmpeffrghnihgvlhcuufhhrghhrghfuceougdrshesuggrnhhi vghlrdhshhgrhhgrfhdrnhgrmhgvqeenucfkphepjeelrddujeeirdduvdehrddvfedvne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugdrshes uggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Date: Thu, 26 Mar 2020 22:02:50 +0000 From: Daniel Shahaf To: Vin Shelton Cc: "Zsh Hackers' List" Subject: Re: pwd -r vs. pwd test failure Message-ID: <20200326220250.11861abd@tarpaulin.shahaf.local2> In-Reply-To: References: X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Vin Shelton wrote on Thu, 26 Mar 2020 08:22 -0400: > I got a test failure in B13 today: >=20 Thanks for the report. > Test ../../../src/zsh-2020-03-26/Test/B13whence.ztst failed: output diffe= rs > from expected as shown above for: > ( > path=3D( $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. >=20 > Looking at the diff, I realized that my build directory is under a symlin= k; > /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 f= ix > the test, or should $PWD track realpath? I don't see any reason to change the semantics of $PWD, so let's fix the test: 8<-- =46rom a3c664f6bede4c33eb57a7a76134c1121069970b Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 26 Mar 2020 21:41:49 +0000 Subject: [PATCH] Fix new test when ${PWD}'s value contains symlinks. --- Test/B13whence.ztst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Test/B13whence.ztst b/Test/B13whence.ztst index ea0a4dae5..5993c2247 100644 --- a/Test/B13whence.ztst +++ b/Test/B13whence.ztst @@ -1,7 +1,10 @@ %prep =20 mkdir whence.tmp - pushd whence.tmp + ln -s . whence.tmp/cwd + # cd through the symlink in order to test the case that ${prefix} and + # ${prefix:P} are different + pushd whence.tmp/cwd ln -s real step3 ln -s step3 step2 ln -s step2 step1 @@ -21,8 +24,8 @@ whence -s step1 ) 0q:whence symlink resolution ->$prefix/step1 -> $prefix/step2 -> $prefix/step3 -> $prefix/real ->$prefix/step1 -> $prefix/real +>${prefix:P}/step1 -> ${prefix:P}/step2 -> ${prefix:P}/step3 -> ${prefix:P= }/real +>${prefix:P}/step1 -> ${prefix:P}/real =20 ( path=3D( $PWD/whence.tmp $path ) Thanks again, Daniel