about summary refs log tree commit diff
path: root/third_party/nix/tests/lang/eval-okay-sort.nix
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/tests/lang/eval-okay-sort.nix')
-rw-r--r--third_party/nix/tests/lang/eval-okay-sort.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/third_party/nix/tests/lang/eval-okay-sort.nix b/third_party/nix/tests/lang/eval-okay-sort.nix
new file mode 100644
index 000000000000..8299c3a4a3aa
--- /dev/null
+++ b/third_party/nix/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"; } ]) 
+]