diff options
author | nickajacks1 <128185314+nickajacks1@users.noreply.github.com> | 2024-01-05 21:39:23 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-06 13:39:23 +0800 |
commit | f0905a14d1117335c08b7eb586e409eef24846fc (patch) | |
tree | 1aac56c01248ba86df27bae805faf3a1480ea712 /uri_test.go | |
parent | test(expvarhandler): fix failure when using -count to run more than once (#1688) (diff) | |
download | fasthttp-f0905a14d1117335c08b7eb586e409eef24846fc.tar.gz fasthttp-f0905a14d1117335c08b7eb586e409eef24846fc.tar.bz2 fasthttp-f0905a14d1117335c08b7eb586e409eef24846fc.zip |
test: migrate remaining fuzzit tests to go 1.18 fuzzing (#1687)
Diffstat (limited to 'uri_test.go')
-rw-r--r-- | uri_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/uri_test.go b/uri_test.go index 5996bcb..c3f6d9b 100644 --- a/uri_test.go +++ b/uri_test.go @@ -9,6 +9,25 @@ import ( "time" ) +func FuzzURIUpdateBytes(f *testing.F) { + u := AcquireURI() + defer ReleaseURI(u) + + f.Add([]byte(`http://foobar.com/aaa/bb?cc`)) + f.Add([]byte(`//foobar.com/aaa/bb?cc`)) + f.Add([]byte(`/aaa/bb?cc`)) + f.Add([]byte(`xx?yy=abc`)) + + f.Fuzz(func(t *testing.T, uri []byte) { + u.UpdateBytes(uri) + + w := bytes.Buffer{} + if _, err := u.WriteTo(&w); err != nil { + t.Fatalf("unexpected error: %v", err) + } + }) +} + func TestURICopyToQueryArgs(t *testing.T) { t.Parallel() |