From 3445b88cb1437df9a4c196a76aa85bf9e82edab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Stemmer?= Date: Sat, 24 Sep 2022 20:52:08 +0100 Subject: [PATCH] parser/gotest: Add fuzzing test for parseLine --- parser/gotest/gotest_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/parser/gotest/gotest_test.go b/parser/gotest/gotest_test.go index e4ec5a5..b2580d6 100644 --- a/parser/gotest/gotest_test.go +++ b/parser/gotest/gotest_test.go @@ -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) + } + }) +}