Skip to content

Commit

Permalink
test: add fuzz test for parse method
Browse files Browse the repository at this point in the history
  • Loading branch information
tauslim committed Feb 29, 2024
1 parent 76bc5a9 commit d0a9073
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
*.iml
*.iml
testdata
16 changes: 16 additions & 0 deletions parser_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package gorql

import (
"strings"
"testing"
)

func FuzzParse(f *testing.F) {
f.Fuzz(func(t *testing.T, a string) {
p, err := NewParser(nil)
if err != nil {
t.Fatalf("New parser error :%s", err)
}
_, _ = p.Parse(strings.NewReader(a))
})
}

0 comments on commit d0a9073

Please sign in to comment.