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

C02 '-N cond' test (was: [zsh:code] New commit [e89060] by dana)



On 14 Feb 2020, at 16:34, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Thanks.  It worked on my machine, probably because I link modules
> statically.

np, sorry i didn't notice it before now.

Semi-related: I can't remember if this always happens or it's intermittent,
but the '-N cond' test in C02 fails for me as well, apparently because APFS
defaults to (the equivalent of) noatime.

I found workers/38355, but both the thread and the test itself are a little
hard for me to follow. Could we not do something like this?

  touch $newnewnew
  sleep 2
  if ! zmodload -F zsh/stat b:zstat 2> /dev/null; then
    ZTST_skip='[[ -N file ]] not tested; zsh/stat not available'
  elif ! touch -a $unmodified 2> /dev/null; then
    ZTST_skip='[[ -N file ]] not tested; touch failed'
  elif [[ "$(zstat +atime $unmodified)" == "$(zstat +mtime $unmodified)" ]]; then
    ZTST_skip='[[ -N file ]] not supported on this file system'
  else
    [[ -N $newnewnew && ! -N $unmodified ]]
  fi

PS: I'm not worried about this for 5.8, since i've seen it before; just
mentioning while it's on my mind

dana



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