about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/tests/tvix_tests')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.exp1
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.nix12
2 files changed, 13 insertions, 0 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
new file mode 100644
index 000000000000..d9599941033a
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.exp
@@ -0,0 +1 @@
+[ 0 -1 -1 0 0 0 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
new file mode 100644
index 000000000000..769de79ad583
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.nix
@@ -0,0 +1,12 @@
+[
+  (builtins.compareVersions "1.2.3" "1.2.3")
+  (builtins.compareVersions "1.2.2" "1.2.3")
+  (builtins.compareVersions "1.2.3" "1.2.40")
+  (builtins.compareVersions "1.2.3" ".1.2.3")
+  (builtins.compareVersions "1.2.3" "1..2.3")
+  (builtins.compareVersions "1.2.3" "1.2.3.")
+  (builtins.compareVersions "1.2.3" "1.2")
+  (builtins.compareVersions "1.2.3" "1.2.a")
+  (builtins.compareVersions "1a.b" "1a.2")
+  (builtins.compareVersions "1" "")
+]