zsh-workers
 help / color / mirror / Atom feed
* is-at-least false positive (5.8.0.2 / 5.8)
@ 2020-08-10  8:08 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2020-08-10  8:08 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-10  8:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-10  8:08 is-at-least false positive (5.8.0.2 / 5.8) Daniel Shahaf

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git