mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
tests: Reduce the number of calls to mkTestDerivationFromNixvimModule
This commit is contained in:
parent
71126bfebe
commit
50d865275d
2 changed files with 44 additions and 26 deletions
|
@ -62,13 +62,10 @@ let
|
|||
# handled by mkTestDerivation
|
||||
handleTestFile =
|
||||
{ namespace, cases }:
|
||||
lib.attrsets.mapAttrs' (case: config: {
|
||||
name = lib.strings.concatStringsSep "-" (namespace ++ [ case ]);
|
||||
value = config;
|
||||
}) cases;
|
||||
|
||||
# Helper function that calls `//` for each attrset of a list
|
||||
concatMany = lib.lists.foldr lib.mergeAttrs { };
|
||||
{
|
||||
name = lib.strings.concatStringsSep "-" namespace;
|
||||
cases = lib.mapAttrsToList (name: case: { inherit case name; }) cases;
|
||||
};
|
||||
in
|
||||
# An attrset of 'test-name' -> 'test-config'
|
||||
concatMany (builtins.map handleTestFile testsListEvaluated)
|
||||
# A list of the form [ { name = "..."; modules = [ /* test cases */ ]; } ]
|
||||
builtins.map handleTestFile testsListEvaluated
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue