Skip to content

Commit

Permalink
Fuzz filter package with Go 1.18's fuzzer
Browse files Browse the repository at this point in the history
Signed-off-by: Kazuyoshi Kato <[email protected]>
  • Loading branch information
kzys committed Apr 18, 2022
1 parent 7cbde74 commit b497e64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 32 deletions.
32 changes: 0 additions & 32 deletions contrib/fuzz/filters_fuzzers.go

This file was deleted.

10 changes: 10 additions & 0 deletions filters/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,13 @@ func TestOperatorStrings(t *testing.T) {
}
}
}

func FuzzFiltersParse(f *testing.F) {
f.Add("foo=bar")
f.Fuzz(func(t *testing.T, expr string) {
filter, err := Parse(expr)
if filter != nil && err != nil {
t.Fatal("either filter or err must be non-nil")
}
})
}

0 comments on commit b497e64

Please sign in to comment.