about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-09-21T11·42+0200
committersterni <sternenseemann@systemli.org>2022-09-21T14·23+0000
commit7ea249969a0c76af4a9375cb61ad7e9e6ea816f4 (patch)
tree5ff2035d4f036971a42effe1d6504ca796c74f75 /tvix
parent367a6a13d4c629265ef8f9f9a0d6be4f37bb7f2a (diff)
test(tvix/eval): add more compareVersions test cases involving pre r/4952
This asserts the not-quite lexicographical property of the comparison.

Change-Id: Iad68081e4b3a7106513f479643de87065dc47739
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6721
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.exp2
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.nix6
2 files changed, 7 insertions, 1 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.exp
index 0ec1768e2cba..cec788922439 100644
--- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.exp
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.exp
@@ -1 +1 @@
-[ 0 -1 -1 0 0 0 1 1 -1 1 -1 -1 -1 0 1 1 1 1 -1 -1 -1 -1 -1 ]
+[ 0 -1 -1 0 0 0 1 1 -1 1 -1 1 -1 -1 -1 -1 0 -1 -1 0 1 1 1 1 -1 -1 -1 -1 -1 ]
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.nix
index dd3c8a0ac123..32b959df0453 100644
--- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.nix
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.nix
@@ -19,6 +19,12 @@ in
   (cmp "1a.b" "1a.2")
   (cmp "1" "")
   (cmp "1.0" "1.0.0")
+  (cmp "2.3" "2.3pre")
+  (cmp "2.3" "2.3.0pre")
+  (cmp "2.3pre" "2.3.0pre")
+  (cmp "2.3" "2.3prepre")
+  (cmp "2.3pre" "2.3prepre")
+  (cmp "2.3prepre" "2.3prepre")
   # Subset of test cases from eval-okay-versions.nix shipped by C++ Nix
   (cmp "1.0" "2.3")
   (cmp "2.1" "2.3")