From 8751764236e5d85cc394652288cda7a63fe78f94 Mon Sep 17 00:00:00 2001 From: Naïm Favier Date: Wed, 22 Mar 2023 11:23:21 +0100 Subject: lib/modules: better error for invalid option declarations Make `byName` aware of whether it's processing options or config to give slightly more accurate error messages. --- lib/tests/modules.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/tests/modules.sh') diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index 8081b186a2f9f..c1cf0a94a1b38 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -189,7 +189,7 @@ checkConfigOutput '^"foo"$' config.submodule.foo ./declare-submoduleWith-special ## shorthandOnlyDefines config behaves as expected checkConfigOutput '^true$' config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-shorthand.nix checkConfigError 'is not of type `boolean' config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-noshorthand.nix -checkConfigError "You're trying to declare a value of type \`bool'\n\s*rather than an attribute-set for the option" config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-shorthand.nix +checkConfigError "You're trying to define a value of type \`bool'\n\s*rather than an attribute set for the option" config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-shorthand.nix checkConfigOutput '^true$' config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-noshorthand.nix ## submoduleWith should merge all modules in one swoop -- cgit 1.4.1