From 0d904f9f10590d3a9117af27151f8c4fe2aea5ff Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sat, 14 Jan 2023 09:57:16 -0700 Subject: Completed gemtext package. resolves #2 - fuzz testing - split out line parsing into a separate file - changed line type-specific public []byte fields to string accessor methods - added document parsing test for a stress test doc - added dependency on stretchr/testify --- gemtext/fuzz_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 gemtext/fuzz_test.go (limited to 'gemtext/fuzz_test.go') diff --git a/gemtext/fuzz_test.go b/gemtext/fuzz_test.go new file mode 100644 index 0000000..dce0587 --- /dev/null +++ b/gemtext/fuzz_test.go @@ -0,0 +1,16 @@ +package gemtext_test + +import ( + "bytes" + "testing" + + "tildegit.org/tjp/gus/gemtext" +) + +func FuzzParse(f *testing.F) { + f.Fuzz(func(t *testing.T, input []byte) { + if _, err := gemtext.Parse(bytes.NewBuffer(input)); err != nil { + t.Errorf("Parse error: %s", err.Error()) + } + }) +} -- cgit v1.2.3