Skip to content

Commit

Permalink
Merge pull request #6819 from kzys/native-fuzz-filter
Browse files Browse the repository at this point in the history
Fuzz filter package with Go 1.18's fuzzer
  • Loading branch information
fuweid authored Apr 19, 2022
2 parents 476b9c7 + b497e64 commit 26a3ab4
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 26a3ab4

Please sign in to comment.