Skip to content

Commit dd5d57e

Browse files
authored
Merge pull request #2478 from AdamKorcz/fuzz1
add fuzz test for store package
2 parents cb27d68 + 5323b68 commit dd5d57e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

pkg/store/fuzz_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package store
2+
3+
import (
4+
"os"
5+
"path/filepath"
6+
"testing"
7+
)
8+
9+
func FuzzLoadYAMLByFilePath(f *testing.F) {
10+
f.Fuzz(func(t *testing.T, fileContents []byte) {
11+
localFile := filepath.Join(t.TempDir(), "yaml_file.yml")
12+
err := os.WriteFile(localFile, fileContents, 0o600)
13+
if err != nil {
14+
t.Fatal(err)
15+
}
16+
//nolint:errcheck // The test doesn't check the return value
17+
LoadYAMLByFilePath(localFile)
18+
})
19+
}

0 commit comments

Comments
 (0)