Tryout go test fuzzing

This commit is contained in:
2022-09-01 03:59:18 +02:00
parent fce78d234d
commit 38ff8949b9
3 changed files with 40 additions and 0 deletions

View File

@@ -21,3 +21,18 @@ func TestBBoltStore(t *testing.T) {
}
testLoginAttemptStore(s, t)
}
func FuzzBBoltStore(f *testing.F) {
dir := f.TempDir()
file, err := os.CreateTemp(dir, "apiary-test-bbolt")
if err != nil {
f.Fatal(err)
}
fname := file.Name()
file.Close()
s, err := store.NewBBoltStore(fname)
if err != nil {
f.Fatal(err)
}
fuzzLoginAttemptStore(s, f)
}