diff options
author | Robert Hensing <robert@roberthensing.nl> | 2023-12-23 11:40:16 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2023-12-23 11:40:27 +0100 |
commit | 6f4d0b52611812854394cecfee8081823b105e5b (patch) | |
tree | 149c8a0dd3d7e6efba307e83708bbb26bae61642 /lib/tests | |
parent | e525be5a078d47c9162963de7991042f096c4ed8 (diff) |
lib.types: Improve descriptions of composed types that have commas
Type: either ints.positive (enum ["auto"]) Before: positive integer, meaning >0 or value "auto" (singular enum) After: positive integer, meaning >0, or value "auto" (singular enum)
Diffstat (limited to 'lib/tests')
-rw-r--r-- | lib/tests/misc.nix | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index cf7fa9f2e2849..3059878ba0695 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -1959,6 +1959,18 @@ runTests { expr = (with types; int).description; expected = "signed integer"; }; + testTypeDescriptionIntsPositive = { + expr = (with types; ints.positive).description; + expected = "positive integer, meaning >0"; + }; + testTypeDescriptionIntsPositiveOrEnumAuto = { + expr = (with types; either ints.positive (enum ["auto"])).description; + expected = ''positive integer, meaning >0, or value "auto" (singular enum)''; + }; + testTypeDescriptionListOfPositive = { + expr = (with types; listOf ints.positive).description; + expected = "list of (positive integer, meaning >0)"; + }; testTypeDescriptionListOfInt = { expr = (with types; listOf int).description; expected = "list of signed integer"; |