git.iko.soy/typeable/nixpkgs
on master help sign in
lib/tests/modules.sh: update to Nix 2.4 syntax
commitfd4390146e2ccb043bbb0a07c1cd89fe01ee1315 authorBernardo Meurer <bernardo@meurer.org> dateWed 3 Nov 2021, 16:19 (5 years ago) parent32c35c5
1 file changed+12−12
lib/tests/modules.sh+12−12
lib/tests/modules.sh+12−12
@@ -62,17 +62,17 @@ checkConfigError() {
6262
6363# Check boolean option.
6464checkConfigOutput "false" config.enable ./declare-enable.nix
65−checkConfigError 'The option .* does not exist. Definition values:\n- In .*: true' config.enable ./define-enable.nix
65+checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*: true' config.enable ./define-enable.nix
6666
6767# Check integer types.
6868# unsigned
6969checkConfigOutput "42" config.value ./declare-int-unsigned-value.nix ./define-value-int-positive.nix
70−checkConfigError 'A definition for option .* is not of type.*unsigned integer.*. Definition values:\n- In .*: -23' config.value ./declare-int-unsigned-value.nix ./define-value-int-negative.nix
70+checkConfigError 'A definition for option .* is not of type.*unsigned integer.*. Definition values:\n\s*- In .*: -23' config.value ./declare-int-unsigned-value.nix ./define-value-int-negative.nix
7171# positive
72−checkConfigError 'A definition for option .* is not of type.*positive integer.*. Definition values:\n- In .*: 0' config.value ./declare-int-positive-value.nix ./define-value-int-zero.nix
72+checkConfigError 'A definition for option .* is not of type.*positive integer.*. Definition values:\n\s*- In .*: 0' config.value ./declare-int-positive-value.nix ./define-value-int-zero.nix
7373# between
7474checkConfigOutput "42" config.value ./declare-int-between-value.nix ./define-value-int-positive.nix
75−checkConfigError 'A definition for option .* is not of type.*between.*-21 and 43.*inclusive.*. Definition values:\n- In .*: -23' config.value ./declare-int-between-value.nix ./define-value-int-negative.nix
75+checkConfigError 'A definition for option .* is not of type.*between.*-21 and 43.*inclusive.*. Definition values:\n\s*- In .*: -23' config.value ./declare-int-between-value.nix ./define-value-int-negative.nix
7676
7777# Check either types
7878# types.either
@@ -125,7 +125,7 @@ checkConfigOutput 'true' "$@" ./define-enable.nix ./define-attrsOfSub-foo-enable
125125set -- config.enable ./define-enable.nix ./declare-enable.nix
126126checkConfigOutput "true" "$@"
127127checkConfigOutput "false" "$@" ./disable-define-enable.nix
128−checkConfigError "The option .*enable.* does not exist. Definition values:\n- In .*: true" "$@" ./disable-declare-enable.nix
128+checkConfigError "The option .*enable.* does not exist. Definition values:\n\s*- In .*: true" "$@" ./disable-declare-enable.nix
129129checkConfigError "attribute .*enable.* in selection path .*config.enable.* not found" "$@" ./disable-define-enable.nix ./disable-declare-enable.nix
130130checkConfigError "attribute .*enable.* in selection path .*config.enable.* not found" "$@" ./disable-enable-modules.nix
131131
@@ -142,18 +142,18 @@ checkConfigError 'infinite recursion encountered' "$@"
142142
143143# Check _module.check.
144144set -- config.enable ./declare-enable.nix ./define-enable.nix ./define-attrsOfSub-foo.nix
145−checkConfigError 'The option .* does not exist. Definition values:\n- In .*' "$@"
145+checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*' "$@"
146146checkConfigOutput "true" "$@" ./define-module-check.nix
147147
148148# Check coerced value.
149149checkConfigOutput "\"42\"" config.value ./declare-coerced-value.nix
150150checkConfigOutput "\"24\"" config.value ./declare-coerced-value.nix ./define-value-string.nix
151−checkConfigError 'A definition for option .* is not.*string or signed integer convertible to it.*. Definition values:\n- In .*: \[ \]' config.value ./declare-coerced-value.nix ./define-value-list.nix
151+checkConfigError 'A definition for option .* is not.*string or signed integer convertible to it.*. Definition values:\n\s*- In .*: \[ \]' config.value ./declare-coerced-value.nix ./define-value-list.nix
152152
153153# Check coerced value with unsound coercion
154154checkConfigOutput "12" config.value ./declare-coerced-value-unsound.nix
155−checkConfigError 'A definition for option .* is not of type .*. Definition values:\n- In .*: "1000"' config.value ./declare-coerced-value-unsound.nix ./define-value-string-bigint.nix
156−checkConfigError 'unrecognised JSON value' config.value ./declare-coerced-value-unsound.nix ./define-value-string-arbitrary.nix
155+checkConfigError 'A definition for option .* is not of type .*. Definition values:\n\s*- In .*: "1000"' config.value ./declare-coerced-value-unsound.nix ./define-value-string-bigint.nix
156+checkConfigError 'json.exception.parse_error' config.value ./declare-coerced-value-unsound.nix ./define-value-string-arbitrary.nix
157157
158158# Check mkAliasOptionModule.
159159checkConfigOutput "true" config.enable ./alias-with-priority.nix
@@ -169,7 +169,7 @@ checkConfigOutput "foo" config.submodule.foo ./declare-submoduleWith-special.nix
169169## shorthandOnlyDefines config behaves as expected
170170checkConfigOutput "true" config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-shorthand.nix
171171checkConfigError 'is not of type `boolean' config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-noshorthand.nix
172−checkConfigError "You're trying to declare a value of type \`bool'\nrather than an attribute-set for the option" config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-shorthand.nix
172+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
173173checkConfigOutput "true" config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-noshorthand.nix
174174
175175## submoduleWith should merge all modules in one swoop
@@ -193,7 +193,7 @@ checkConfigOutput "true" config.submodule.enable ./declare-submoduleWith-path.ni
193193checkConfigOutput "true" config.enable ./disable-recursive/main.nix
194194checkConfigOutput "true" config.enable ./disable-recursive/{main.nix,disable-foo.nix}
195195checkConfigOutput "true" config.enable ./disable-recursive/{main.nix,disable-bar.nix}
196−checkConfigError 'The option .* does not exist. Definition values:\n- In .*: true' config.enable ./disable-recursive/{main.nix,disable-foo.nix,disable-bar.nix}
196+checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*: true' config.enable ./disable-recursive/{main.nix,disable-foo.nix,disable-bar.nix}
197197
198198# Check that imports can depend on derivations
199199checkConfigOutput "true" config.enable ./import-from-store.nix
@@ -277,7 +277,7 @@ checkConfigOutput baz config.value.nested.bar.baz ./types-anything/mk-mods.nix
277277## types.functionTo
278278checkConfigOutput "input is input" config.result ./functionTo/trivial.nix
279279checkConfigOutput "a b" config.result ./functionTo/merging-list.nix
280−checkConfigError 'A definition for option .fun.\[function body\]. is not of type .string.. Definition values:\n- In .*wrong-type.nix' config.result ./functionTo/wrong-type.nix
280+checkConfigError 'A definition for option .fun.\[function body\]. is not of type .string.. Definition values:\n\s*- In .*wrong-type.nix' config.result ./functionTo/wrong-type.nix
281281checkConfigOutput "b a" config.result ./functionTo/list-order.nix
282282checkConfigOutput "a c" config.result ./functionTo/merging-attrs.nix
283283