From b333395be54397a62e6befe2bc91664f53306b41 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 15 Oct 2021 16:48:38 +0200 Subject: lib/tests: Add tests for emptyValue --- lib/tests/modules/emptyValues.nix | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lib/tests/modules/emptyValues.nix (limited to 'lib/tests/modules/emptyValues.nix') diff --git a/lib/tests/modules/emptyValues.nix b/lib/tests/modules/emptyValues.nix new file mode 100644 index 00000000000..77825de3281 --- /dev/null +++ b/lib/tests/modules/emptyValues.nix @@ -0,0 +1,36 @@ +{ lib, ... }: +let + inherit (lib) types; +in { + + options = { + int = lib.mkOption { + type = types.lazyAttrsOf types.int; + }; + list = lib.mkOption { + type = types.lazyAttrsOf (types.listOf types.int); + }; + nonEmptyList = lib.mkOption { + type = types.lazyAttrsOf (types.nonEmptyListOf types.int); + }; + attrs = lib.mkOption { + type = types.lazyAttrsOf (types.attrsOf types.int); + }; + null = lib.mkOption { + type = types.lazyAttrsOf (types.nullOr types.int); + }; + submodule = lib.mkOption { + type = types.lazyAttrsOf (types.submodule {}); + }; + }; + + config = { + int.a = lib.mkIf false null; + list.a = lib.mkIf false null; + nonEmptyList.a = lib.mkIf false null; + attrs.a = lib.mkIf false null; + null.a = lib.mkIf false null; + submodule.a = lib.mkIf false null; + }; + +} -- cgit 1.4.1