22 lines
327 B
Go
22 lines
327 B
Go
|
package main_test
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"git.akyoto.dev/go/web"
|
||
|
)
|
||
|
|
||
|
func BenchmarkWeb(b *testing.B) {
|
||
|
bench(
|
||
|
b,
|
||
|
func() web.Server {
|
||
|
return web.NewServer()
|
||
|
},
|
||
|
func(s web.Server, method string, path string) {
|
||
|
s.Router().Add(method, path, func(ctx web.Context) error {
|
||
|
return ctx.Bytes(payload)
|
||
|
})
|
||
|
},
|
||
|
)
|
||
|
}
|