diff options
Diffstat (limited to 'nixpkgs/lib/tests')
-rwxr-xr-x | nixpkgs/lib/tests/modules.sh | 2 | ||||
-rw-r--r-- | nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix | 9 | ||||
-rw-r--r-- | nixpkgs/lib/tests/modules/alias-with-priority.nix | 5 |
3 files changed, 11 insertions, 5 deletions
diff --git a/nixpkgs/lib/tests/modules.sh b/nixpkgs/lib/tests/modules.sh index a72777cbf2a6..eadaa0521b35 100755 --- a/nixpkgs/lib/tests/modules.sh +++ b/nixpkgs/lib/tests/modules.sh @@ -149,7 +149,7 @@ checkConfigOutput "1 2 3 4 5 6 7 8 9 10" config.result ./loaOf-with-long-list.ni # Check loaOf with many merges of lists. checkConfigOutput "1 2 3 4 5 6 7 8 9 10" config.result ./loaOf-with-many-list-merges.nix -# Check mkAliasOptionModuleWithPriority. +# Check mkAliasOptionModule. checkConfigOutput "true" config.enable ./alias-with-priority.nix checkConfigOutput "true" config.enableAlias ./alias-with-priority.nix checkConfigOutput "false" config.enable ./alias-with-priority-can-override.nix diff --git a/nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix b/nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix index a6b26895f3a8..9a18c9d9f613 100644 --- a/nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix +++ b/nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix @@ -1,5 +1,8 @@ # This is a test to show that mkAliasOptionModule sets the priority correctly # for aliased options. +# +# This test shows that an alias with a high priority is able to override +# a non-aliased option. { config, lib, ... }: @@ -32,10 +35,10 @@ with lib; imports = [ # Create an alias for the "enable" option. - (mkAliasOptionModuleWithPriority [ "enableAlias" ] [ "enable" ]) + (mkAliasOptionModule [ "enableAlias" ] [ "enable" ]) - # Disable the aliased option, but with a default (low) priority so it - # should be able to be overridden by the next import. + # Disable the aliased option with a high priority so it + # should override the next import. ( { config, lib, ... }: { enableAlias = lib.mkForce false; diff --git a/nixpkgs/lib/tests/modules/alias-with-priority.nix b/nixpkgs/lib/tests/modules/alias-with-priority.nix index 923483684cb1..a35a06fc6974 100644 --- a/nixpkgs/lib/tests/modules/alias-with-priority.nix +++ b/nixpkgs/lib/tests/modules/alias-with-priority.nix @@ -1,5 +1,8 @@ # This is a test to show that mkAliasOptionModule sets the priority correctly # for aliased options. +# +# This test shows that an alias with a low priority is able to be overridden +# with a non-aliased option. { config, lib, ... }: @@ -32,7 +35,7 @@ with lib; imports = [ # Create an alias for the "enable" option. - (mkAliasOptionModuleWithPriority [ "enableAlias" ] [ "enable" ]) + (mkAliasOptionModule [ "enableAlias" ] [ "enable" ]) # Disable the aliased option, but with a default (low) priority so it # should be able to be overridden by the next import. |