modules lib: type description in type error message
This commit is contained in:
parent
025eae1a8c
commit
5b759293e0
@ -326,7 +326,7 @@ rec {
|
|||||||
# Type-check the remaining definitions, and merge them.
|
# Type-check the remaining definitions, and merge them.
|
||||||
mergedValue = foldl' (res: def:
|
mergedValue = foldl' (res: def:
|
||||||
if type.check def.value then res
|
if type.check def.value then res
|
||||||
else throw "The option value `${showOption loc}' in `${def.file}' is not a ${type.name}.")
|
else throw "The option value `${showOption loc}' in `${def.file}' is not a ${type.description}.")
|
||||||
(type.merge loc defsFinal) defsFinal;
|
(type.merge loc defsFinal) defsFinal;
|
||||||
|
|
||||||
isDefined = defsFinal != [];
|
isDefined = defsFinal != [];
|
||||||
|
@ -118,7 +118,7 @@ checkConfigOutput "true" "$@" ./define-module-check.nix
|
|||||||
# Check coerced value.
|
# Check coerced value.
|
||||||
checkConfigOutput "\"42\"" config.value ./declare-coerced-value.nix
|
checkConfigOutput "\"42\"" config.value ./declare-coerced-value.nix
|
||||||
checkConfigOutput "\"24\"" config.value ./declare-coerced-value.nix ./define-value-string.nix
|
checkConfigOutput "\"24\"" config.value ./declare-coerced-value.nix ./define-value-string.nix
|
||||||
checkConfigError 'The option value .* in .* is not a coercedTo.' config.value ./declare-coerced-value.nix ./define-value-list.nix
|
checkConfigError 'The option value .* in .* is not a string or integer.' config.value ./declare-coerced-value.nix ./define-value-list.nix
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
====== module tests ======
|
====== module tests ======
|
||||||
|
Loading…
Reference in New Issue
Block a user