about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-11-23T19·51+0100
committersterni <sternenseemann@systemli.org>2022-12-02T14·06+0000
commit7bab0c26ee8d35488a98ff00474e1447bb14c699 (patch)
treea802c9c7923e5096c6f4d45b6128205d0bc07e67 /tvix
parent3b92ff454f574ce3ece912ebf26790c0228cc48a (diff)
test(tvix/eval): verify pointer equality in list comparisons r/5368
Change-Id: I617d402c8ecc7aaf607c4bdcd58a06ebddb71fac
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7370
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: Adam Joseph <adam@westernsemico.com>
Diffstat (limited to 'tvix')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.exp1
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.nix6
-rw-r--r--tvix/verify-lang-tests/default.nix1
3 files changed, 8 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.exp
new file mode 100644
index 000000000000..27ba77ddaf61
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.exp
@@ -0,0 +1 @@
+true
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.nix
new file mode 100644
index 000000000000..f60d27d38157
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.nix
@@ -0,0 +1,6 @@
+# For an explanation of this behavior see //tvix/docs/value-pointer-equality.md
+let
+  f = owo: "thia";
+in
+
+[ f 42 ] > [ f 21 ]
\ No newline at end of file
diff --git a/tvix/verify-lang-tests/default.nix b/tvix/verify-lang-tests/default.nix
index b526085bb97e..4de92ab6c8b9 100644
--- a/tvix/verify-lang-tests/default.nix
+++ b/tvix/verify-lang-tests/default.nix
@@ -54,6 +54,7 @@ let
     # Comparable lists are not in Nix 2.3
     "eval-okay-sort.nix" = [ nix ];
     "eval-okay-compare-lists.nix" = [ nix ];
+    "eval-okay-value-pointer-compare.nix" = [ nix ];
     # getAttrPos gains support for functionArgs-returned sets after 2.3
     "eval-okay-getattrpos-functionargs.nix" = [ nix ];
     # groupBy appeared (long) after 2.3