diff options
author | Robert Hensing <robert@roberthensing.nl> | 2023-07-08 22:18:36 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2023-08-14 10:44:56 +0200 |
commit | 0d472a62012364d064f0b75f1da491242c6ae9c6 (patch) | |
tree | 368ea6304232e38b80a6892495dffedb39e75e56 /lib/tests/modules.sh | |
parent | 450d6437aeda4c90bb948f6f1f7d25a005ab9bb2 (diff) | |
download | nixlib-0d472a62012364d064f0b75f1da491242c6ae9c6.tar nixlib-0d472a62012364d064f0b75f1da491242c6ae9c6.tar.gz nixlib-0d472a62012364d064f0b75f1da491242c6ae9c6.tar.bz2 nixlib-0d472a62012364d064f0b75f1da491242c6ae9c6.tar.lz nixlib-0d472a62012364d064f0b75f1da491242c6ae9c6.tar.xz nixlib-0d472a62012364d064f0b75f1da491242c6ae9c6.tar.zst nixlib-0d472a62012364d064f0b75f1da491242c6ae9c6.zip |
lib/modules: Report a good error when option tree has bare type
Note that this removes the possibility of declaring an option named `_type`.
Diffstat (limited to 'lib/tests/modules.sh')
-rwxr-xr-x | lib/tests/modules.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index b933a24a57a1..5f2e3f2a3114 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -393,6 +393,11 @@ checkConfigError \ config.set \ ./declare-set.nix ./declare-enable-nested.nix +# Options: accidental use of an option-type instead of option (or other tagged type; unlikely) +checkConfigError 'Expected an option declaration at option path .result. but got an attribute set with type option-type' config.result ./options-type-error-typical.nix +checkConfigError 'Expected an option declaration at option path .result.here. but got an attribute set with type option-type' config.result.here ./options-type-error-typical-nested.nix +checkConfigError 'Expected an option declaration at option path .result. but got an attribute set with type configuration' config.result ./options-type-error-configuration.nix + # Check that that merging of option collisions doesn't depend on type being set checkConfigError 'The option .group..*would be a parent of the following options, but its type .<no description>. does not support nested options.\n\s*- option.s. with prefix .group.enable..*' config.group.enable ./merge-typeless-option.nix |