Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
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: <takimoto-j@kba.biglobe.ne.jp>
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." <takimoto-j@kba.biglobe.ne.jp>
In-Reply-To: <160430111131.ZM11437@torch.brasslantern.com>
Date: Mon, 9 May 2016 22:42:34 +0900
Content-Transfer-Encoding: 7bit
Message-Id: <FEE16E72-B6B1-4CDE-B32D-EB111C13240C@kba.biglobe.ne.jp>
References: <ufa1t5pl0yg.fsf@epithumia.math.uh.edu>  <160429131027.ZM22749@torch.brasslantern.com>  <ufashy4ghvy.fsf@epithumia.math.uh.edu>  <20160430004639.GA1360@tarsus.local2>  <20160430010131.GA34472@CptOrmolo.darkstar>  <20160430012828.GA3334@tarsus.local2>  <CAH+w=7b9kKY1Xr5YHFHMS4YzSptJWwU_N6p+s3R=Q=QjYYSo3w@mail.gmail.com>  <160430105547.ZM10892@torch.brasslantern.com> <160430111131.ZM11437@torch.brasslantern.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
X-Mailer: Apple Mail (2.1510)
X-Biglobe-Spnum: 53329
X-Seq: zsh-workers 38445


On 2016/05/01, at 3:11, Bart Schaefer <schaefer@brasslantern.com> 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



