Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
is-at-least false positive (5.8.0.2 / 5.8)
- X-seq: zsh-workers 47314
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: is-at-least false positive (5.8.0.2 / 5.8)
- Date: Mon, 10 Aug 2020 08:08:57 +0000
- Archived-at: <https://zsh.org/workers/47314>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-08/20200810080857.26d160ee%40tarpaulin.shahaf.local2>
- Authentication-results: zsh.org; iprev=pass (wout4-smtp.messagingengine.com) smtp.remote-ip=64.147.123.20; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:subject:message-id :mime-version:content-type:content-transfer-encoding; s=fm1; bh= 5FN3n75ZWU5yaAyV42nt6gxLyuMmeCwcwgFQ+2t61+k=; b=UJI2bU0fr6r+5635 9XRQjC6bMKn0dZ/64MbV+5tEtDHqpZnRJJVY/rL73WdT6S5jfnvHPCJG3HAEHxWP BdCvt6m2QXDfnvC9lJT7D7ZU0rL/3U03I3dy4IgGQMeaSTVDGZbsTD3n2LPTz+9P uq4q08olAPAL7oqT9bO6il0YdOnh9k8TsdjnAiny3wLw2GpDMrYsM5MB9SiFL5Qt oYeQt8Rv6NBYN2vN4aaFPWZJCGRDEzFH7B4mX00pdclV9f+6gNeJ4X4CSZiLAynF wTTV1pcEF5l6SnKqDUmRM8iVls6PTx9sd7d4jrFNLoSlaNY17XeXCppkUP5Z+/kR YMXtZQ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=5FN3n7 5ZWU5yaAyV42nt6gxLyuMmeCwcwgFQ+2t61+k=; b=meKxtTzVzQuwj90ACaWEum /+SLiGzns4M7ruUuM1rwUn+Nn977lTTOPsT9rEEaY/9EOO+UrtzOHZoIHZH2mIZn 3aDEIi/r7rHFBfBDCRvfgCCfHMAhsuRd5FLgnlRiO+bkcOQ+ZCz4HKch+0qhuoF7 DFj2uJZW4gRNzboKVjTDIl131r2omtG8474f05cvcscY7EYZUGDIBEK8quz/8pdS H/XGA/bKOaNu+rMUwV9QWQJFWV/j10b7PFjceu2h6wuzg+WAf0ZrvxXmXd24zJ3j 96QxjQvxqNk69MRiWJZqb0u0KV0rFgwlQUOxxiNbDzKZjypsAhRQTU6uldEVwheQ ==
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- Sender: Sympa Owner <sympa@xxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author