diff options
author | Silvan Mosberger <contact@infinisil.com> | 2024-02-10 02:52:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-10 02:52:45 +0100 |
commit | f37ba1976518f61217dcee655412288b09441cde (patch) | |
tree | 06392f647e18d6b283f46e49bf66abb9d1b71910 /lib/tests/modules.sh | |
parent | ddc9133e53aa4a48135a6e9e50277c327ac73b72 (diff) | |
parent | 542f5d4f4d80a35d8f03aa5cf2a2a0b1a0345c41 (diff) |
Merge pull request #284512 from hercules-ci/lib-types-unique-merge
lib.types.unique: Check inner type deeply
Diffstat (limited to 'lib/tests/modules.sh')
-rwxr-xr-x | lib/tests/modules.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index 072b92b383658..b3bbdf9485ac0 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -407,6 +407,16 @@ checkConfigOutput "{}" config.submodule.a ./emptyValues.nix checkConfigError 'The option .int.a. is used but not defined' config.int.a ./emptyValues.nix checkConfigError 'The option .nonEmptyList.a. is used but not defined' config.nonEmptyList.a ./emptyValues.nix +# types.unique +# requires a single definition +checkConfigError 'The option .examples\.merged. is defined multiple times while it.s expected to be unique' config.examples.merged.a ./types-unique.nix +# user message is printed +checkConfigError 'We require a single definition, because seeing the whole value at once helps us maintain critical invariants of our system.' config.examples.merged.a ./types-unique.nix +# let the inner merge function check the values (on demand) +checkConfigError 'A definition for option .examples\.badLazyType\.a. is not of type .string.' config.examples.badLazyType.a ./types-unique.nix +# overriding still works (unlike option uniqueness) +checkConfigOutput '^"bee"$' config.examples.override.b ./types-unique.nix + ## types.raw checkConfigOutput '^true$' config.unprocessedNestingEvaluates.success ./raw.nix checkConfigOutput "10" config.processedToplevel ./raw.nix |