@@ -43,11 +43,16 @@ func testValidValuesForSupportedValuesValidator[T configValue](
43
43
f supportedValuesValidatorFunc [T ],
44
44
values ... T ,
45
45
) {
46
- runValidatorTests (t , func (g * WithT , v T ) {
47
- valid , supportedValues := f (v )
48
- g .Expect (valid ).To (BeTrue (), createFailureMessage (v ))
49
- g .Expect (supportedValues ).To (BeNil (), createFailureMessage (v ))
50
- }, "valid_value" , values ... )
46
+ runValidatorTests (
47
+ t ,
48
+ func (g * WithT , v T ) {
49
+ valid , supportedValues := f (v )
50
+ g .Expect (valid ).To (BeTrue (), createFailureMessage (v ))
51
+ g .Expect (supportedValues ).To (BeNil (), createFailureMessage (v ))
52
+ },
53
+ "valid_value" ,
54
+ values ... ,
55
+ )
51
56
}
52
57
53
58
func testInvalidValuesForSupportedValuesValidator [T configValue ](
@@ -56,11 +61,16 @@ func testInvalidValuesForSupportedValuesValidator[T configValue](
56
61
supportedValuesMap map [T ]struct {},
57
62
values ... T ,
58
63
) {
59
- runValidatorTests (t , func (g * WithT , v T ) {
60
- valid , supportedValues := f (v )
61
- g .Expect (valid ).To (BeFalse (), createFailureMessage (v ))
62
- g .Expect (supportedValues ).To (Equal (getSortedKeysAsString (supportedValuesMap )), createFailureMessage (v ))
63
- }, "invalid_value" , values ... )
64
+ runValidatorTests (
65
+ t ,
66
+ func (g * WithT , v T ) {
67
+ valid , supportedValues := f (v )
68
+ g .Expect (valid ).To (BeFalse (), createFailureMessage (v ))
69
+ g .Expect (supportedValues ).To (Equal (getSortedKeysAsString (supportedValuesMap )), createFailureMessage (v ))
70
+ },
71
+ "invalid_value" ,
72
+ values ... ,
73
+ )
64
74
}
65
75
66
76
func TestValidateInSupportedValues (t * testing.T ) {
@@ -74,12 +84,19 @@ func TestValidateInSupportedValues(t *testing.T) {
74
84
return validateInSupportedValues (value , supportedValues )
75
85
}
76
86
77
- testValidValuesForSupportedValuesValidator (t , validator ,
87
+ testValidValuesForSupportedValuesValidator (
88
+ t ,
89
+ validator ,
78
90
"value1" ,
79
91
"value2" ,
80
- "value3" )
81
- testInvalidValuesForSupportedValuesValidator (t , validator , supportedValues ,
82
- "value4" )
92
+ "value3" ,
93
+ )
94
+ testInvalidValuesForSupportedValuesValidator (
95
+ t ,
96
+ validator ,
97
+ supportedValues ,
98
+ "value4" ,
99
+ )
83
100
}
84
101
85
102
func TestGetSortedKeysAsString (t * testing.T ) {
0 commit comments