Skip to content

Commit

Permalink
chore: move cookie fuzz test to go 1.18 fuzzing
Browse files Browse the repository at this point in the history
  • Loading branch information
nickajacks1 committed Jan 2, 2024
1 parent 868ee45 commit 8c26f30
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ tags
.vscode
.DS_Store
vendor/
testdata/fuzz
16 changes: 16 additions & 0 deletions cookie_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ func TestCookiePanic(t *testing.T) {
}
}

func FuzzCookieParse(f *testing.F) {
inputs := []string{
`xxx=yyy`,
`xxx=yyy; expires=Tue, 10 Nov 2009 23:00:00 GMT; domain=foobar.com; path=/a/b`,
" \n\t\"",
}
for _, input := range inputs {
f.Add([]byte(input))
}
c := AcquireCookie()
defer ReleaseCookie(c)
f.Fuzz(func(t *testing.T, cookie []byte) {
_ = c.ParseBytes(cookie)
})
}

func TestCookieValueWithEqualAndSpaceChars(t *testing.T) {
t.Parallel()

Expand Down
25 changes: 0 additions & 25 deletions fuzzit/cookie/cookie_fuzz.go

This file was deleted.

0 comments on commit 8c26f30

Please sign in to comment.