parser/gotest: Add fuzzing test for parseLine

This commit is contained in:
Joël Stemmer 2022-09-24 20:52:08 +01:00
parent f50ae24655
commit 3445b88cb1

View File

@ -221,3 +221,15 @@ func TestParseLine(t *testing.T) {
})
}
}
func FuzzParseLine(f *testing.F) {
for _, test := range parseLineTests {
f.Add(test.input)
}
f.Fuzz(func(t *testing.T, in string) {
events := NewParser().parseLine(in)
if len(events) == 0 {
t.Fatalf("parseLine(%q) did not return any results", in)
}
})
}