about summary refs log tree commit diff
path: root/third_party/nix/src/tests/lang/eval-okay-sort.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-08-15T01·51+0100
committertazjin <mail@tazj.in>2020-08-15T01·58+0000
commit1a48f390784a30df3e7e8259e71866d6916c5231 (patch)
treeb577f8c2f15b8dad005f589d3d442d8b4d36c119 /third_party/nix/src/tests/lang/eval-okay-sort.nix
parente458e5255ad9aff8b4831a288c4f694f329fc7f3 (diff)
fix(tvix): Ensure prim_sort actually uses the right outlist r/1655
Previously the outlist would not be used, and it would sort god knows
what in the out value.

This was probably introduced by the std::vector refactoring, and the
language test for builtins.sort was disabled. Whatever reason there
was for disabling it seems to be gone, so we're re-enabling it.

Change-Id: I98941c2cad78df58ff7bea1ece3aaa4133e94bf8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1757
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'third_party/nix/src/tests/lang/eval-okay-sort.nix')
-rw-r--r--third_party/nix/src/tests/lang/eval-okay-sort.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/third_party/nix/src/tests/lang/eval-okay-sort.nix b/third_party/nix/src/tests/lang/eval-okay-sort.nix
new file mode 100644
index 000000000000..8299c3a4a3aa
--- /dev/null
+++ b/third_party/nix/src/tests/lang/eval-okay-sort.nix
@@ -0,0 +1,8 @@
+with builtins;
+
+[ (sort lessThan [ 483 249 526 147 42 77 ])
+  (sort (x: y: y < x) [ 483 249 526 147 42 77 ])
+  (sort lessThan [ "foo" "bar" "xyzzy" "fnord" ])
+  (sort (x: y: x.key < y.key)
+    [ { key = 1; value = "foo"; } { key = 2; value = "bar"; } { key = 1; value = "fnord"; } ]) 
+]