diff options
author | Silvan Mosberger <infinisil@icloud.com> | 2018-04-04 16:51:46 +0200 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2018-05-06 23:58:36 +0200 |
commit | b16a69289aae7a8aeb7d0410649764d9d2328e2f (patch) | |
tree | aea743319550a2ade7680df4725a8f97244cc7fd /lib/tests/modules | |
parent | ef8996f15ea2dd5aace0f61f9ab03f3dfa3d4975 (diff) |
lib/types: Add coercedTo unsound tests
Diffstat (limited to 'lib/tests/modules')
-rw-r--r-- | lib/tests/modules/declare-coerced-value-unsound.nix | 10 | ||||
-rw-r--r-- | lib/tests/modules/define-value-string-arbitrary.nix | 3 | ||||
-rw-r--r-- | lib/tests/modules/define-value-string-bigint.nix | 3 |
3 files changed, 16 insertions, 0 deletions
diff --git a/lib/tests/modules/declare-coerced-value-unsound.nix b/lib/tests/modules/declare-coerced-value-unsound.nix new file mode 100644 index 000000000000..7a017f24e77d --- /dev/null +++ b/lib/tests/modules/declare-coerced-value-unsound.nix @@ -0,0 +1,10 @@ +{ lib, ... }: + +{ + options = { + value = lib.mkOption { + default = "12"; + type = lib.types.coercedTo lib.types.str lib.toInt lib.types.ints.s8; + }; + }; +} diff --git a/lib/tests/modules/define-value-string-arbitrary.nix b/lib/tests/modules/define-value-string-arbitrary.nix new file mode 100644 index 000000000000..8e3abaf536a0 --- /dev/null +++ b/lib/tests/modules/define-value-string-arbitrary.nix @@ -0,0 +1,3 @@ +{ + value = "foobar"; +} diff --git a/lib/tests/modules/define-value-string-bigint.nix b/lib/tests/modules/define-value-string-bigint.nix new file mode 100644 index 000000000000..f27e31985c92 --- /dev/null +++ b/lib/tests/modules/define-value-string-bigint.nix @@ -0,0 +1,3 @@ +{ + value = "1000"; +} |