From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130 invoked by alias); 9 May 2016 14:28:53 -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: X-Seq: 38445 Received: (qmail 29165 invoked from network); 9 May 2016 14:28:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Biglobe-Sender: Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Bug in C02cont.ztst's -N test From: "Jun T." In-Reply-To: <160430111131.ZM11437@torch.brasslantern.com> Date: Mon, 9 May 2016 22:42:34 +0900 Content-Transfer-Encoding: 7bit Message-Id: References: <160429131027.ZM22749@torch.brasslantern.com> <20160430004639.GA1360@tarsus.local2> <20160430010131.GA34472@CptOrmolo.darkstar> <20160430012828.GA3334@tarsus.local2> <160430105547.ZM10892@torch.brasslantern.com> <160430111131.ZM11437@torch.brasslantern.com> To: "zsh-workers@zsh.org" X-Mailer: Apple Mail (2.1510) X-Biglobe-Spnum: 53329 On 2016/05/01, at 3:11, Bart Schaefer wrote: > diff --git a/Test/C02cond.ztst b/Test/C02cond.ztst (snip) > > - sleep 2 > - cat $unmodified > - touch $newnewnew (snip) > + elif { (( ! $+unmodified_ls )) && > + { sleep 2; cat $unmodified } && (snip) > > else > + touch $newnewnew Moving 'touch $newnewnew' into the 'else' block causes a problem on a system where the test for -N is skipped, for example Cygwin. The file newnewnew is not created at all, and the next test [[ $newnewnew -nt $zlnfs && ! ($unmodified -nt $zlnfs) ]] fails. diff --git a/Test/C02cond.ztst b/Test/C02cond.ztst index b0e84dd..63c89dd 100644 --- a/Test/C02cond.ztst +++ b/Test/C02cond.ztst @@ -152,12 +152,14 @@ unmodified_ls="$(ls -lu $unmodified)" print -u $ZTST_fd 'This test takes up to 60 seconds...' fi + sleep 2 + touch $newnewnew if [[ $OSTYPE == "cygwin" ]]; then ZTST_skip="[[ -N file ]] not supported on Cygwin" elif (( isnfs )); then ZTST_skip="[[ -N file ]] not supported with NFS" elif { (( ! $+unmodified_ls )) && - { sleep 2; cat $unmodified } && + cat $unmodified && { df -k -- ${$(print -r -- "$mtab" | awk '/noatime/ {print $1,$3}'):-""} | tr -s ' ' | fgrep -- "$(df -k . | tail -1 | tr -s ' ')" } >&/dev/null } || @@ -168,7 +170,6 @@ done }; then ZTST_skip="[[ -N file ]] not supported with noatime file system" else - touch $newnewnew [[ -N $newnewnew && ! -N $unmodified ]] fi 0:-N cond