summary refs log tree commit diff
path: root/lib/tests
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2017-10-31 14:23:05 +0100
committerProfpatsch <mail@profpatsch.de>2017-11-05 15:56:32 +0100
commitf8e6cd3465c6efdfd3b9db510c6365c31740644c (patch)
tree43fef1aac6a4d377c30752fe633936eb9ec0e043 /lib/tests
parent77648da2336b4a85bbbf33866402a775e3cbdae8 (diff)
downloadnixlib-f8e6cd3465c6efdfd3b9db510c6365c31740644c.tar
nixlib-f8e6cd3465c6efdfd3b9db510c6365c31740644c.tar.gz
nixlib-f8e6cd3465c6efdfd3b9db510c6365c31740644c.tar.bz2
nixlib-f8e6cd3465c6efdfd3b9db510c6365c31740644c.tar.lz
nixlib-f8e6cd3465c6efdfd3b9db510c6365c31740644c.tar.xz
nixlib-f8e6cd3465c6efdfd3b9db510c6365c31740644c.tar.zst
nixlib-f8e6cd3465c6efdfd3b9db510c6365c31740644c.zip
lib/types: add tests for `ints.between` and `ints.unsigned`
The int types are trivial invocations of `ints.between`, so they are not tested
explicitely.
Diffstat (limited to 'lib/tests')
-rwxr-xr-xlib/tests/modules.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh
index ba0c67fb7d42..ac0372e66f8a 100755
--- a/lib/tests/modules.sh
+++ b/lib/tests/modules.sh
@@ -61,6 +61,14 @@ checkConfigError() {
 checkConfigOutput "false" config.enable ./declare-enable.nix
 checkConfigError 'The option .* defined in .* does not exist.' config.enable ./define-enable.nix
 
+# Check integer types.
+# unsigned
+checkConfigOutput "42" config.value ./declare-int-unsigned-value.nix ./define-value-int-positive.nix
+checkConfigError 'The option value .* in .* is not of type.*unsigned integer.*' config.value ./declare-int-unsigned-value.nix ./define-value-int-negative.nix
+# between
+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 mkForce without submodules.
 set -- config.enable ./declare-enable.nix ./define-enable.nix
 checkConfigOutput "true" "$@"
@@ -126,7 +134,7 @@ checkConfigOutput "true" "$@" ./define-module-check.nix
 # Check coerced value.
 checkConfigOutput "\"42\"" config.value ./declare-coerced-value.nix
 checkConfigOutput "\"24\"" config.value ./declare-coerced-value.nix ./define-value-string.nix
-checkConfigError 'The option value .* in .* is not a string or integer.' config.value ./declare-coerced-value.nix ./define-value-list.nix
+checkConfigError 'The option value .* in .* is not.*string or signed integer.*' config.value ./declare-coerced-value.nix ./define-value-list.nix
 
 cat <<EOF
 ====== module tests ======