diff --git a/pkgs/lib/lists.nix b/pkgs/lib/lists.nix index b9eba9ab478..ede7018fb23 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 04acb7632ea..298bdffc379 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]; + }; }