diff options
author | Silvan Mosberger <infinisil@icloud.com> | 2019-08-01 15:55:33 +0200 |
---|---|---|
committer | Silvan Mosberger <infinisil@icloud.com> | 2019-08-06 14:08:42 +0200 |
commit | 9a44f44d4c0d33775b63ad9dd387fd77f810074e (patch) | |
tree | 36292691567b9951c21260b1714654565898a49d /lib/tests/modules.sh | |
parent | c6e7bc2977f728efcecfb954bbb38d436e98b798 (diff) | |
download | nixpkgs-9a44f44d4c0d33775b63ad9dd387fd77f810074e.tar nixpkgs-9a44f44d4c0d33775b63ad9dd387fd77f810074e.tar.gz nixpkgs-9a44f44d4c0d33775b63ad9dd387fd77f810074e.tar.bz2 nixpkgs-9a44f44d4c0d33775b63ad9dd387fd77f810074e.tar.lz nixpkgs-9a44f44d4c0d33775b63ad9dd387fd77f810074e.tar.xz nixpkgs-9a44f44d4c0d33775b63ad9dd387fd77f810074e.tar.zst nixpkgs-9a44f44d4c0d33775b63ad9dd387fd77f810074e.zip |
lib/types: Add oneOf, extension of either to a list of types
Diffstat (limited to 'lib/tests/modules.sh')
-rwxr-xr-x | lib/tests/modules.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index eadaa0521b3..cf344122cf4 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -71,6 +71,15 @@ checkConfigError 'The option value .* in .* is not of type.*positive integer.*' checkConfigOutput "42" config.value ./declare-int-between-value.nix ./define-value-int-positive.nix checkConfigError 'The option value .* in .* is not of type.*between.*-21 and 43.*inclusive.*' config.value ./declare-int-between-value.nix ./define-value-int-negative.nix +# Check either types +# types.either +checkConfigOutput "42" config.value ./declare-either.nix ./define-value-int-positive.nix +checkConfigOutput "\"24\"" config.value ./declare-either.nix ./define-value-string.nix +# types.oneOf +checkConfigOutput "42" config.value ./declare-oneOf.nix ./define-value-int-positive.nix +checkConfigOutput "[ ]" config.value ./declare-oneOf.nix ./define-value-list.nix +checkConfigOutput "\"24\"" config.value ./declare-oneOf.nix ./define-value-string.nix + # Check mkForce without submodules. set -- config.enable ./declare-enable.nix ./define-enable.nix checkConfigOutput "true" "$@" |