@@ -303,21 +303,21 @@ func TestStorageCopyFromPath(t *testing.T) {
303303 return
304304 }
305305
306- matchFile := func (t * testing.T , storage * Storage , artifact sourcev1.Artifact , file * File , wantErr bool ) {
306+ matchFile := func (t * testing.T , storage * Storage , artifact sourcev1.Artifact , file * File , expectMismatch bool ) {
307307 c , err := os .ReadFile (storage .LocalPath (artifact ))
308308 if err != nil {
309309 t .Fatalf ("failed reading file: %v" , err )
310310 }
311- if (string (c ) != string (file .Content )) != wantErr {
312- t .Errorf ("artifact content does not match, got: %q, want: %q" , string (c ), string (file .Content ))
311+ if (string (c ) != string (file .Content )) != expectMismatch {
312+ t .Errorf ("artifact content does not match and not expecting mismatch , got: %q, want: %q" , string (c ), string (file .Content ))
313313 }
314314 }
315315
316316 tests := []struct {
317- name string
318- file * File
319- want * File
320- wantErr bool
317+ name string
318+ file * File
319+ want * File
320+ expectMismatch bool
321321 }{
322322 {
323323 name : "content match" ,
@@ -338,9 +338,9 @@ func TestStorageCopyFromPath(t *testing.T) {
338338 },
339339 want : & File {
340340 Name : "manifest.yaml" ,
341- Content : []byte (`bad contents` ),
341+ Content : []byte (`mismatch contents` ),
342342 },
343- wantErr : true ,
343+ expectMismatch : true ,
344344 },
345345 }
346346 for _ , tt := range tests {
@@ -360,7 +360,7 @@ func TestStorageCopyFromPath(t *testing.T) {
360360 if err := storage .CopyFromPath (& artifact , absPath ); err != nil {
361361 t .Errorf ("CopyFromPath() error = %v" , err )
362362 }
363- matchFile (t , storage , artifact , tt .want , tt .wantErr )
363+ matchFile (t , storage , artifact , tt .want , tt .expectMismatch )
364364 })
365365 }
366366}
0 commit comments