@@ -149,7 +149,7 @@ func TestImageSourceCELValidationRules(t *testing.T) {
149
149
obj , err := runtime .DefaultUnstructuredConverter .ToUnstructured (& tc .spec ) //nolint:gosec
150
150
require .NoError (t , err )
151
151
errs := validator (obj , nil )
152
- require .Equal (t , len (tc .wantErrs ), len ( errs ), "want" , tc .wantErrs , "got" , errs )
152
+ require .Len (t , errs , len (tc .wantErrs ), "want" , tc .wantErrs , "got" , errs )
153
153
for i := range tc .wantErrs {
154
154
got := errs [i ].Error ()
155
155
assert .Equal (t , tc .wantErrs [i ], got )
@@ -242,7 +242,7 @@ func TestResolvedImageSourceCELValidation(t *testing.T) {
242
242
} {
243
243
t .Run (name , func (t * testing.T ) {
244
244
errs := validator (tc .spec .Ref , nil )
245
- require .Equal (t , len (tc .wantErrs ), len ( errs ), "want" , tc .wantErrs , "got" , errs )
245
+ require .Len (t , errs , len (tc .wantErrs ), "want" , tc .wantErrs , "got" , errs )
246
246
for i := range tc .wantErrs {
247
247
got := errs [i ].Error ()
248
248
assert .Equal (t , tc .wantErrs [i ], got )
@@ -286,7 +286,7 @@ func TestClusterCatalogURLsCELValidation(t *testing.T) {
286
286
t .Run (name , func (t * testing.T ) {
287
287
errs := validator (tc .urls .Base , nil )
288
288
fmt .Println (errs )
289
- require .Equal (t , len (tc .wantErrs ), len ( errs ))
289
+ require .Len (t , errs , len (tc .wantErrs ))
290
290
for i := range tc .wantErrs {
291
291
got := errs [i ].Error ()
292
292
assert .Equal (t , tc .wantErrs [i ], got )
@@ -327,7 +327,7 @@ func TestSourceCELValidation(t *testing.T) {
327
327
require .NoError (t , err )
328
328
errs := validator (obj , nil )
329
329
fmt .Println (errs )
330
- require .Equal (t , len (tc .wantErrs ), len ( errs ))
330
+ require .Len (t , errs , len (tc .wantErrs ))
331
331
for i := range tc .wantErrs {
332
332
got := errs [i ].Error ()
333
333
assert .Equal (t , tc .wantErrs [i ], got )
@@ -368,7 +368,7 @@ func TestResolvedSourceCELValidation(t *testing.T) {
368
368
obj , err := runtime .DefaultUnstructuredConverter .ToUnstructured (& tc .source ) //nolint:gosec
369
369
require .NoError (t , err )
370
370
errs := validator (obj , nil )
371
- require .Equal (t , len (tc .wantErrs ), len ( errs ))
371
+ require .Len (t , errs , len (tc .wantErrs ))
372
372
for i := range tc .wantErrs {
373
373
got := errs [i ].Error ()
374
374
assert .Equal (t , tc .wantErrs [i ], got )
0 commit comments