lib.types: Add parentheses where description is ambiguous
This commit is contained in:
@@ -1206,4 +1206,57 @@ runTests {
|
||||
expr = strings.levenshteinAtMost 3 "hello" "Holla";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testTypeDescriptionInt = {
|
||||
expr = (with types; int).description;
|
||||
expected = "signed integer";
|
||||
};
|
||||
testTypeDescriptionListOfInt = {
|
||||
expr = (with types; listOf int).description;
|
||||
expected = "list of signed integer";
|
||||
};
|
||||
testTypeDescriptionListOfListOfInt = {
|
||||
expr = (with types; listOf (listOf int)).description;
|
||||
expected = "list of list of signed integer";
|
||||
};
|
||||
testTypeDescriptionListOfEitherStrOrBool = {
|
||||
expr = (with types; listOf (either str bool)).description;
|
||||
expected = "list of (string or boolean)";
|
||||
};
|
||||
testTypeDescriptionEitherListOfStrOrBool = {
|
||||
expr = (with types; either (listOf bool) str).description;
|
||||
expected = "(list of boolean) or string";
|
||||
};
|
||||
testTypeDescriptionEitherStrOrListOfBool = {
|
||||
expr = (with types; either str (listOf bool)).description;
|
||||
expected = "string or list of boolean";
|
||||
};
|
||||
testTypeDescriptionOneOfListOfStrOrBool = {
|
||||
expr = (with types; oneOf [ (listOf bool) str ]).description;
|
||||
expected = "(list of boolean) or string";
|
||||
};
|
||||
testTypeDescriptionOneOfListOfStrOrBoolOrNumber = {
|
||||
expr = (with types; oneOf [ (listOf bool) str number ]).description;
|
||||
expected = "(list of boolean) or string or signed integer or floating point number";
|
||||
};
|
||||
testTypeDescriptionEitherListOfBoolOrEitherStringOrNumber = {
|
||||
expr = (with types; either (listOf bool) (either str number)).description;
|
||||
expected = "(list of boolean) or string or signed integer or floating point number";
|
||||
};
|
||||
testTypeDescriptionEitherEitherListOfBoolOrStringOrNumber = {
|
||||
expr = (with types; either (either (listOf bool) str) number).description;
|
||||
expected = "(list of boolean) or string or signed integer or floating point number";
|
||||
};
|
||||
testTypeDescriptionEitherNullOrBoolOrString = {
|
||||
expr = (with types; either (nullOr bool) str).description;
|
||||
expected = "null or boolean or string";
|
||||
};
|
||||
testTypeDescriptionEitherListOfEitherBoolOrStrOrInt = {
|
||||
expr = (with types; either (listOf (either bool str)) int).description;
|
||||
expected = "(list of (boolean or string)) or signed integer";
|
||||
};
|
||||
testTypeDescriptionEitherIntOrListOrEitherBoolOrStr = {
|
||||
expr = (with types; either int (listOf (either bool str))).description;
|
||||
expected = "signed integer or list of (boolean or string)";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user