diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-01-14 09:57:16 -0700 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-01-14 09:58:32 -0700 |
commit | 0d904f9f10590d3a9117af27151f8c4fe2aea5ff (patch) | |
tree | 95a6f1a0055bdb2120684c239a14c7466a3a117f /gemtext/fuzz_test.go | |
parent | aa23984bc21f99e00b8552e928d23ef02bb745f3 (diff) |
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
Diffstat (limited to 'gemtext/fuzz_test.go')
-rw-r--r-- | gemtext/fuzz_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
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()) + } + }) +} |