about summary refs log tree commit diff
path: root/tvix/eval
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-09-21T14·25+0200
committersterni <sternenseemann@systemli.org>2022-09-22T23·06+0000
commitee0b89c4029fe027174018c14dcf7fcff342c8bf (patch)
treebcc3a7c9e02f5c2cbdfdb2be7751ec74b99c900b /tvix/eval
parent3fec7185f42b53288f27ab3889490b0aef046149 (diff)
test(tvix/eval): test word behavior in builtins.compareVersions r/4957
We delegate to Rust std's Ord trait, so we should at least do a sanity
check here.

Change-Id: I9596068f8ab3e51b79602de0bac79af6d558086e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6723
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval')
-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.nix5
2 files changed, 6 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 cec788922439..e69498c3e1c3 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 -1 -1 -1 0 -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 -1 1 -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 32b959df0453..cce554b4494a 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
@@ -25,6 +25,11 @@ in
   (cmp "2.3" "2.3prepre")
   (cmp "2.3pre" "2.3prepre")
   (cmp "2.3prepre" "2.3prepre")
+  # check that the plain word comparison (via Ord) behaves the same
+  (cmp "foo" "bar")
+  (cmp "FoO" "fOo")
+  (cmp "foo" "fooo")
+  (cmp "foopre" "foo")
   # Subset of test cases from eval-okay-versions.nix shipped by C++ Nix
   (cmp "1.0" "2.3")
   (cmp "2.1" "2.3")