git.iko.soy/typeable/nixpkgs
on master help sign in
lib/types: clear up coercedTo description
commitcd5736116c971ed08826b71a15a2221233b3d44f authorSilvan Mosberger <infinisil@icloud.com> dateWed 4 Apr 2018, 16:55 (9 years ago) parentb16a692
2 files changed+4−4
lib/tests/modules.sh+2−2 lib/types.nix+2−2
lib/tests/modules.sh+2−2
@@ -136,11 +136,11 @@ checkConfigOutput "true" "$@" ./define-module-check.nix
136136# Check coerced value.
137137checkConfigOutput "\"42\"" config.value ./declare-coerced-value.nix
138138checkConfigOutput "\"24\"" config.value ./declare-coerced-value.nix ./define-value-string.nix
139−checkConfigError 'The option value .* in .* is not.*string or signed integer.*' config.value ./declare-coerced-value.nix ./define-value-list.nix
139+checkConfigError 'The option value .* in .* is not.*string or signed integer convertible to it' config.value ./declare-coerced-value.nix ./define-value-list.nix
140140
141141# Check coerced value with unsound coercion
142142checkConfigOutput "12" config.value ./declare-coerced-value-unsound.nix
143−checkConfigError 'The option value .* in .* is not.*8 bit signed integer.* or string.*' config.value ./declare-coerced-value-unsound.nix ./define-value-string-bigint.nix
143+checkConfigError 'The option value .* in .* is not.*8 bit signed integer.* or string convertible to it' config.value ./declare-coerced-value-unsound.nix ./define-value-string-bigint.nix
144144checkConfigError 'unrecognised JSON value' config.value ./declare-coerced-value-unsound.nix ./define-value-string-arbitrary.nix
145145
146146cat <<EOF
lib/types.nix+2−2
@@ -256,7 +256,7 @@ rec {
256256 functor = (defaultFunctor name) // { wrapped = elemType; };
257257 };
258258
259− nonEmptyListOf = elemType:
259+ nonEmptyListOf = elemType:
260260 let list = addCheck (types.listOf elemType) (l: l != []);
261261 in list // { description = "non-empty " + list.description; };
262262
@@ -419,7 +419,7 @@ rec {
419419 assert coercedType.getSubModules == null;
420420 mkOptionType rec {
421421 name = "coercedTo";
422− description = "${finalType.description} or ${coercedType.description}";
422+ description = "${finalType.description} or ${coercedType.description} convertible to it";
423423 check = x: finalType.check x || (coercedType.check x && finalType.check (coerceFunc x));
424424 merge = loc: defs:
425425 let