diff options
author | Robert Hensing <robert@roberthensing.nl> | 2024-01-29 08:14:36 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2024-04-04 11:54:45 +0200 |
commit | 0bc978322178fe6dbe91fe1477d275e1005d5e77 (patch) | |
tree | 1294d9c493f7705c1310821f4657da6b4cae48f2 /lib/tests/modules | |
parent | 42d3b54f0dab73e42e6643e0a3c0ee140b6c8112 (diff) |
lib.types.attrTag: Support type merging
Diffstat (limited to 'lib/tests/modules')
-rw-r--r-- | lib/tests/modules/types-attrTag.nix | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tests/modules/types-attrTag.nix b/lib/tests/modules/types-attrTag.nix index b105d01512dc5..b8b1dff21e19f 100644 --- a/lib/tests/modules/types-attrTag.nix +++ b/lib/tests/modules/types-attrTag.nix @@ -39,6 +39,9 @@ in yay = mkOption { type = types.int; }; + extensible = mkOption { + type = types.enum [ "foo" ]; + }; } ); }; @@ -71,6 +74,9 @@ in nay = mkOption { type = types.bool; }; + extensible = mkOption { + type = types.enum [ "bar" ]; + }; } ); }; @@ -89,11 +95,15 @@ in nested.right.left = "not a number"; merged.negative.nay = false; merged.positive.yay = 100; + merged.extensi-foo.extensible = "foo"; + merged.extensi-bar.extensible = "bar"; okChecks = assert config.intStrings.hello.right == "hello world"; assert config.intStrings.numberOne.left == 1; assert config.merged.negative.nay == false; assert config.merged.positive.yay == 100; + assert config.merged.extensi-foo.extensible == "foo"; + assert config.merged.extensi-bar.extensible == "bar"; # assert lib.foldl' (a: b: builtins.trace b a) true (lib.attrNames config.docs); assert config.docs."submodules.<name>.foo.bar".type == "signed integer"; assert config.docs."submodules.<name>.qux".type == "string"; |