diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2012-11-21 21:34:42 -0800 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2012-11-21 21:34:42 -0800 |
commit | cae78ef3e3fd60315fead62da9ef7939039203fc (patch) | |
tree | 7673ca69c4572a1f3e9e788b88c63f7a35739e3c /pkgs | |
parent | 1c3289790558d5c8ec1d3df31795249c5f839b40 (diff) | |
parent | 1a948d97a213f46502e5a4210ed8f24d3a389d25 (diff) | |
download | nixlib-cae78ef3e3fd60315fead62da9ef7939039203fc.tar nixlib-cae78ef3e3fd60315fead62da9ef7939039203fc.tar.gz nixlib-cae78ef3e3fd60315fead62da9ef7939039203fc.tar.bz2 nixlib-cae78ef3e3fd60315fead62da9ef7939039203fc.tar.lz nixlib-cae78ef3e3fd60315fead62da9ef7939039203fc.tar.xz nixlib-cae78ef3e3fd60315fead62da9ef7939039203fc.tar.zst nixlib-cae78ef3e3fd60315fead62da9ef7939039203fc.zip |
Merge pull request #190 from MarcWeber/fixes/lists-sort
fix sort in lists.nix
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/lib/lists.nix | 2 | ||||
-rw-r--r-- | pkgs/lib/tests.nix | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/lib/lists.nix b/pkgs/lib/lists.nix index b9eba9ab4785..ede7018fb236 100644 --- a/pkgs/lib/lists.nix +++ b/pkgs/lib/lists.nix @@ -190,7 +190,7 @@ rec { else let part = partition (strictLess (head l)) (tail l); in - qs part.wrong ([(head l)] ++ qs part.right []); + qs part.wrong ([(head l)] ++ qs part.right concat); in qs list []; diff --git a/pkgs/lib/tests.nix b/pkgs/lib/tests.nix index 04acb7632eab..298bdffc3790 100644 --- a/pkgs/lib/tests.nix +++ b/pkgs/lib/tests.nix @@ -104,5 +104,10 @@ runTests { ]; expected = true; }; + + testSort = { + expr = sort builtins.lessThan [ 40 2 30 42 ]; + expected = [2 30 40 42]; + }; } |