diff options
author | Nikolay Amiantov <ab@fmap.me> | 2017-02-02 01:52:40 +0300 |
---|---|---|
committer | Nikolay Amiantov <ab@fmap.me> | 2017-02-02 01:53:00 +0300 |
commit | fcb20b9feecb33c60d15a98766f7fd1bfbeae13e (patch) | |
tree | cf931d81c3ce283925cde26274ccfcd0f21bafeb /lib/tests/modules | |
parent | 5cbcd3af69d859a6d919ad26261c57649e9c888f (diff) |
module tests: add tests for coercedTo
Diffstat (limited to 'lib/tests/modules')
-rw-r--r-- | lib/tests/modules/declare-coerced-value.nix | 10 | ||||
-rw-r--r-- | lib/tests/modules/define-value-list.nix | 3 | ||||
-rw-r--r-- | lib/tests/modules/define-value-string.nix | 3 |
3 files changed, 16 insertions, 0 deletions
diff --git a/lib/tests/modules/declare-coerced-value.nix b/lib/tests/modules/declare-coerced-value.nix new file mode 100644 index 000000000000..76b12ad53f00 --- /dev/null +++ b/lib/tests/modules/declare-coerced-value.nix @@ -0,0 +1,10 @@ +{ lib, ... }: + +{ + options = { + value = lib.mkOption { + default = 42; + type = lib.types.coercedTo lib.types.int builtins.toString lib.types.str; + }; + }; +} diff --git a/lib/tests/modules/define-value-list.nix b/lib/tests/modules/define-value-list.nix new file mode 100644 index 000000000000..4831c1cc09ba --- /dev/null +++ b/lib/tests/modules/define-value-list.nix @@ -0,0 +1,3 @@ +{ + value = []; +} diff --git a/lib/tests/modules/define-value-string.nix b/lib/tests/modules/define-value-string.nix new file mode 100644 index 000000000000..e7a166965a7a --- /dev/null +++ b/lib/tests/modules/define-value-string.nix @@ -0,0 +1,3 @@ +{ + value = "24"; +} |