Improve fuzz, fix typo, cleanup

This commit is contained in:
2023-08-25 00:10:06 +03:00
parent acb9f97806
commit 3cd5738a13
6 changed files with 7 additions and 13 deletions

View File

@@ -5,6 +5,7 @@ import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -20,11 +21,12 @@ func BenchmarkDup(b *testing.B) {
}
func FuzzDup(f *testing.F) {
c := http.Client{}
f.Fuzz(func(t *testing.T, firstID uint16, secondID uint16) {
c := http.Client{}
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("http://127.0.0.1:8001/%d/%d", firstID, secondID), nil)
require.NoError(t, err)
assert.NoError(t, err)
_, err = c.Do(req)
require.NoError(t, err)
assert.NoError(t, err)
})
}