Skip to content

Commit a0ccb6f

Browse files
committed
merge cases
2 parents 506f1c9 + 4e7da25 commit a0ccb6f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

provider/parameter_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,9 @@ func TestParameterValidationEnforcement(t *testing.T) {
867867
// - [NumIns/DefInv] So the default can be invalid if an input value is valid.
868868
// The value is therefore not really optional, but it is marked as such.
869869
// - [NumInsNotOptsVal | NumsInsNotOpts] values do not need to be in the option set?
870+
// - [NumInsNotNum] number params do not require the value to be a number
871+
// - [LStrInsNotList] list(string) do not require the value to be a list(string)
872+
// - Same with [MulInsNotListOpts]
870873
table, err := os.ReadFile("testdata/parameter_table.md")
871874
require.NoError(t, err)
872875

provider/testdata/parameter_table.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
|----------------------|---------------|-----------|---------|-------------------|------------|----|--------|----------|---------------|
33
| | Empty Vals | | | | | | | | |
44
| Empty | string,number | | | | | | "" | false | |
5+
| EmptyDupeOps | string,number | | | 1,1,1 | | | | | unique |
56
| EmptyList | list(string) | | | | | | "" | false | |
7+
| EmptyListDupeOpts | list(string) | | | ["a"],["a"] | | | | | unique |
68
| EmptyMulti | tag-select | | | | | | "" | false | |
79
| EmptyOpts | string,number | | | 1,2,3 | | | "" | false | |
810
| EmptyRegex | string | | | | world | | | | regex error |
@@ -13,12 +15,13 @@
1315
| | | | | | | | | | |
1416
| | Default Set | No inputs | | | | | | | |
1517
| NumDef | number | | 5 | | | | 5 | true | |
16-
| NumDefNaN | number | | a | | | | | | type "number" |
1718
| NumDefVal | number | | 5 | | 3-7 | | 5 | true | |
1819
| NumDefInv | number | | 5 | | 10- | | | | 10 < 5 < 0 |
1920
| NumDefOpts | number | | 5 | 1,3,5,7 | 2-6 | | 5 | true | |
2021
| NumDefNotOpts | number | | 5 | 1,3,7,9 | 2-6 | | | | valid option |
2122
| NumDefInvOpt | number | | 5 | 1,3,5,7 | 6-10 | | | | 6 < 5 < 10 |
23+
| NumDefNotNum | number | | a | | | | | | type "number" |
24+
| NumDefOptsNotNum | number | | 1 | 1,a,2 | | | | | type "number" |
2225
| | | | | | | | | | |
2326
| StrDef | string | | hello | | | | hello | true | |
2427
| StrDefInv | string | | hello | | world | | | | regex error |
@@ -38,7 +41,8 @@
3841
| | Input Vals | | | | | | | | |
3942
| NumIns | number | 3 | | | | | 3 | false | |
4043
| NumInsOptsNaN | number | 3 | 5 | a,1,2,3,4,5 | 1-3 | | 3 | true | type "number" |
41-
| NumInsNaN | number | a | | | | | | | type "number" |
44+
| NumInsNotNum | number | a | | | | | | | type "number" |
45+
| NumInsNotNumInv | number | a | | | 1-3 | | | | 1 < a < 3 |
4246
| NumInsDef | number | 3 | 5 | | | | 3 | true | |
4347
| NumIns/DefInv | number | 3 | 5 | | 1-3 | | 3 | true | |
4448
| NumIns=DefInv | number | 5 | 5 | | 1-3 | | | | 1 < 5 < 3 |
@@ -49,6 +53,7 @@
4953
| NumInsNotOpts/NoDef | number | 3 | | 1,2,4,5 | | | | | valid option |
5054
| | | | | | | | | | |
5155
| StrIns | string | c | | | | | c | false | |
56+
| StrInsDupeOpts | string | c | | a,b,c,c | | | | | unique |
5257
| StrInsDef | string | c | e | | | | c | true | |
5358
| StrIns/DefInv | string | c | e | | [a-c] | | c | true | |
5459
| StrIns=DefInv | string | e | e | | [a-c] | | | | regex error |
@@ -61,13 +66,15 @@
6166
| | | | | | | | | | |
6267
| | list(string) | | | | | | | | |
6368
| LStrIns | list(string) | ["c"] | | | | | ["c"] | false | |
69+
| LStrInsNotList | list(string) | c | | | | | c | false | |
6470
| LStrInsDef | list(string) | ["c"] | ["e"] | | | | ["c"] | true | |
6571
| LStrIns/DefInv | list(string) | ["c"] | ["e"] | | [a-c] | | | | regex cannot |
6672
| LStrInsOpts | list(string) | ["c"] | ["e"] | ["c"],["d"],["e"] | | | ["c"] | true | |
6773
| LStrInsNotOpts | list(string) | ["c"] | ["e"] | ["d"],["e"] | | | | | valid option |
6874
| LStrInsNotOpts/NoDef | list(string) | ["c"] | | ["d"],["e"] | | | | | valid option |
6975
| | | | | | | | | | |
7076
| MulInsOpts | multi-select | ["c"] | ["e"] | c,d,e | | | ["c"] | true | |
77+
| MulInsNotListOpts | multi-select | c | ["e"] | c,d,e | | | c | true | |
7178
| MulInsNotOpts | multi-select | ["c"] | ["e"] | d,e | | | | | valid option |
7279
| MulInsNotOpts/NoDef | multi-select | ["c"] | | d,e | | | | | valid option |
7380
| MulInsInvOpts | multi-select | ["c"] | ["e"] | c,d,e | [a-c] | | | | regex cannot |

0 commit comments

Comments
 (0)