From 6f70f325138b48f2c9b03a2103371663cb210d7c Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sun, 18 Sep 2022 15:34:33 -0400 Subject: fix(tvix/eval): Force thunks during equality comparison Thunks might be encountered deep in equality comparison (eg nested inside a list or attr-set), at which point we need to force them in order to compare them for equality (or else we panic when trying to get at their value). Fixes: b/192 Change-Id: I912151085f8298f30d5214c7965251c9266443f2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6652 Autosubmit: grfn Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/eval/src/tests/tvix_tests/eval-okay-lazy-equality.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-lazy-equality.nix (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-lazy-equality.nix') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-equality.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-equality.nix new file mode 100644 index 0000000000..b0ec8593a4 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-equality.nix @@ -0,0 +1,11 @@ +let + attrs1 = { x = 1 + 2; }; + attrs2 = { x = 2 + 1; }; + list1 = [ (1 + 2) ]; + list2 = [ (2 + 1) ]; + list3 = [ (2 + 2) ]; +in [ + (attrs1 == attrs2) + (list1 == list2) + (list3 == list2) +] -- cgit 1.4.1