Skip to content

Commit fe408b0

Browse files
committed
Fix verify
1 parent f2c2880 commit fe408b0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

policy/predicate/custom_properties_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func TestCustomPropertiesMatchesAnyOf(t *testing.T) {
146146
runCustomPropertyTestCase(t, customPropertiesTestCtx, []customPropertyTestCase{
147147
{
148148
description: "property matches regex",
149-
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom1": []string{`.*`}})),
149+
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom1": {`.*`}})),
150150
ExpectedPredicateResult: &common.PredicateResult{
151151
Satisfied: true,
152152
Values: defaultTestCustomPropertiesValues,
@@ -155,7 +155,7 @@ func TestCustomPropertiesMatchesAnyOf(t *testing.T) {
155155
},
156156
{
157157
description: "property does not match regex",
158-
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom1": []string{`nomatch`}})),
158+
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom1": {`nomatch`}})),
159159
ExpectedPredicateResult: &common.PredicateResult{
160160
Satisfied: false,
161161
Values: defaultTestCustomPropertiesValues,
@@ -164,7 +164,7 @@ func TestCustomPropertiesMatchesAnyOf(t *testing.T) {
164164
},
165165
{
166166
description: "multiple regexes and one matches",
167-
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom1": []string{`nomatch`, `value1`}})),
167+
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom1": {`nomatch`, `value1`}})),
168168
ExpectedPredicateResult: &common.PredicateResult{
169169
Satisfied: true,
170170
Values: defaultTestCustomPropertiesValues,
@@ -173,7 +173,7 @@ func TestCustomPropertiesMatchesAnyOf(t *testing.T) {
173173
},
174174
{
175175
description: "multiple regexes and none match",
176-
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom1": []string{`nomatch`, `alsonomatch`}})),
176+
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom1": {`nomatch`, `alsonomatch`}})),
177177
ExpectedPredicateResult: &common.PredicateResult{
178178
Satisfied: false,
179179
Values: defaultTestCustomPropertiesValues,
@@ -182,7 +182,7 @@ func TestCustomPropertiesMatchesAnyOf(t *testing.T) {
182182
},
183183
{
184184
description: "multiple properties and one matches",
185-
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom1": []string{`nomatch`}, "custom2": []string{`value2`}})),
185+
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom1": {`nomatch`}, "custom2": {`value2`}})),
186186
ExpectedPredicateResult: &common.PredicateResult{
187187
Satisfied: false,
188188
Values: defaultTestCustomPropertiesValues,
@@ -191,7 +191,7 @@ func TestCustomPropertiesMatchesAnyOf(t *testing.T) {
191191
},
192192
{
193193
description: "multiple properties and none match",
194-
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom1": []string{`nomatch`}, "custom2": []string{`alsonomatch`}})),
194+
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom1": {`nomatch`}, "custom2": {`alsonomatch`}})),
195195
ExpectedPredicateResult: &common.PredicateResult{
196196
Satisfied: false,
197197
Values: defaultTestCustomPropertiesValues,
@@ -200,7 +200,7 @@ func TestCustomPropertiesMatchesAnyOf(t *testing.T) {
200200
},
201201
{
202202
description: "array should never match",
203-
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom3": []string{`.*`}})),
203+
predicate: CustomPropertyMatchesAnyOf(mustCompileRegexpMap(map[string][]string{"custom3": {`.*`}})),
204204
ExpectedPredicateResult: &common.PredicateResult{
205205
Satisfied: false,
206206
Values: defaultTestCustomPropertiesValues,
@@ -223,7 +223,7 @@ func TestCustomPropertiesMatchesNoneOf(t *testing.T) {
223223
runCustomPropertyTestCase(t, customPropertiesTestCtx, []customPropertyTestCase{
224224
{
225225
description: "property matches regex",
226-
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom1": []string{`.*`}})),
226+
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom1": {`.*`}})),
227227
ExpectedPredicateResult: &common.PredicateResult{
228228
Satisfied: false,
229229
Values: defaultTestCustomPropertiesValues,
@@ -232,7 +232,7 @@ func TestCustomPropertiesMatchesNoneOf(t *testing.T) {
232232
},
233233
{
234234
description: "property does not match regex",
235-
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom1": []string{`nomatch`}})),
235+
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom1": {`nomatch`}})),
236236
ExpectedPredicateResult: &common.PredicateResult{
237237
Satisfied: true,
238238
Values: defaultTestCustomPropertiesValues,
@@ -241,7 +241,7 @@ func TestCustomPropertiesMatchesNoneOf(t *testing.T) {
241241
},
242242
{
243243
description: "multiple regexes and one matches",
244-
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom1": []string{`nomatch`, `value1`}})),
244+
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom1": {`nomatch`, `value1`}})),
245245
ExpectedPredicateResult: &common.PredicateResult{
246246
Satisfied: false,
247247
Values: defaultTestCustomPropertiesValues,
@@ -250,7 +250,7 @@ func TestCustomPropertiesMatchesNoneOf(t *testing.T) {
250250
},
251251
{
252252
description: "multiple regexes and none match",
253-
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom1": []string{`nomatch`, `alsonomatch`}})),
253+
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom1": {`nomatch`, `alsonomatch`}})),
254254
ExpectedPredicateResult: &common.PredicateResult{
255255
Satisfied: true,
256256
Values: defaultTestCustomPropertiesValues,
@@ -259,7 +259,7 @@ func TestCustomPropertiesMatchesNoneOf(t *testing.T) {
259259
},
260260
{
261261
description: "multiple properties and one matches",
262-
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom1": []string{`nomatch`}, "custom2": []string{`value2`}})),
262+
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom1": {`nomatch`}, "custom2": {`value2`}})),
263263
ExpectedPredicateResult: &common.PredicateResult{
264264
Satisfied: false,
265265
Values: defaultTestCustomPropertiesValues,
@@ -268,7 +268,7 @@ func TestCustomPropertiesMatchesNoneOf(t *testing.T) {
268268
},
269269
{
270270
description: "multiple properties and none match",
271-
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom1": []string{`nomatch`}, "custom2": []string{`alsonomatch`}})),
271+
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom1": {`nomatch`}, "custom2": {`alsonomatch`}})),
272272
ExpectedPredicateResult: &common.PredicateResult{
273273
Satisfied: true,
274274
Values: defaultTestCustomPropertiesValues,
@@ -277,7 +277,7 @@ func TestCustomPropertiesMatchesNoneOf(t *testing.T) {
277277
},
278278
{
279279
description: "array should never match",
280-
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom3": []string{`.*`}})),
280+
predicate: CustomPropertyMatchesNoneOf(mustCompileRegexpMap(map[string][]string{"custom3": {`.*`}})),
281281
ExpectedPredicateResult: &common.PredicateResult{
282282
Satisfied: true,
283283
Values: defaultTestCustomPropertiesValues,

0 commit comments

Comments
 (0)