mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
lib/tests: Add tests for emptyValue
This commit is contained in:
parent
382289027f
commit
b333395be5
2 changed files with 45 additions and 0 deletions
36
lib/tests/modules/emptyValues.nix
Normal file
36
lib/tests/modules/emptyValues.nix
Normal file
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue