about summary refs log tree commit diff
path: root/lib/tests/modules.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tests/modules.sh')
-rwxr-xr-xlib/tests/modules.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh
index eadaa0521b359..cf344122cf4e4 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" "$@"