zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: is-at-least false positive (5.8.0.2 / 5.8)
Date: Mon, 10 Aug 2020 08:08:57 +0000	[thread overview]
Message-ID: <20200810080857.26d160ee@tarpaulin.shahaf.local2> (raw)

Actual behaviour:

    % is-at-least 5.8.0.2 5.8 && echo yes || echo no 
    yes
    % is-at-least 5.8.0.2 5.8.0.0 && echo yes || echo no
    no

Expected behaviour: Both commands should have printed "no".

Smoke test and regression test attached.

Cheers,

Daniel

diff --git a/Test/Z01is-at-least.ztst b/Test/Z01is-at-least.ztst
new file mode 100644
index 000000000..37952cdf6
--- /dev/null
+++ b/Test/Z01is-at-least.ztst
@@ -0,0 +1,23 @@
+%prep
+  autoload -Uz is-at-least
+
+%test
+
+  versions=(
+    1 1.1 1.1.1 1.2 1.2.1
+    2 2.1 2.1.1 2.2 2.2.1
+    3 3.1 3.1.1 3.2 3.2.1
+  )
+  for (( i = 1; i <= $#versions; ++i)); do
+    for (( j = i+1; j <= $#versions; ++j)); do
+      is-at-least $versions[i] $versions[j] || echo "$versions[i] ≰ $versions[j]"
+      { ! is-at-least $versions[j] $versions[i] } || echo "$versions[j] ≤ $versions[i]"
+    done
+  done
+0:is-at-least smoke test
+
+  is-at-least 5.8.0.2 5.8
+1f:regression tests: Two trailing zeroes are filled in
+# TODO: When fixing this, extend the smoke test to cover this.
+
+%clean


                 reply	other threads:[~2020-08-10  8:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200810080857.26d160ee@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).