diff options
author | Aliaksandr Valialkin <valyala@gmail.com> | 2016-06-10 17:48:06 +0300 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2016-06-10 17:48:06 +0300 |
commit | 312f9e56337b22b8bf1bba99c110934876455064 (patch) | |
tree | 3627fa79082cd7ec3be3387adaa98c9350268ccf /fasthttputil | |
parent | Use fasthttp.PipeConns instead of io.Pipe in StreamReader (diff) | |
download | fasthttp-312f9e56337b22b8bf1bba99c110934876455064.tar.gz fasthttp-312f9e56337b22b8bf1bba99c110934876455064.tar.bz2 fasthttp-312f9e56337b22b8bf1bba99c110934876455064.zip |
move inmemory_listener_timing_test to *_test package, so it could import fasthttp without cycle
Diffstat (limited to 'fasthttputil')
-rw-r--r-- | fasthttputil/inmemory_listener_timing_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fasthttputil/inmemory_listener_timing_test.go b/fasthttputil/inmemory_listener_timing_test.go index 33853ce..abb042a 100644 --- a/fasthttputil/inmemory_listener_timing_test.go +++ b/fasthttputil/inmemory_listener_timing_test.go @@ -1,10 +1,11 @@ -package fasthttputil +package fasthttputil_test import ( "net" "testing" "github.com/valyala/fasthttp" + "github.com/valyala/fasthttp/fasthttputil" ) // BenchmarkPlainStreaming measures end-to-end plaintext streaming performance @@ -40,7 +41,7 @@ func BenchmarkTLSHandshake(b *testing.B) { } func benchmark(b *testing.B, h fasthttp.RequestHandler, isTLS bool) { - ln := NewInmemoryListener() + ln := fasthttputil.NewInmemoryListener() serverStopCh := startServer(b, ln, h, isTLS) c := newClient(ln, isTLS) b.RunParallel(func(pb *testing.PB) { @@ -61,7 +62,7 @@ func handshakeHandler(ctx *fasthttp.RequestCtx) { ctx.SetConnectionClose() } -func startServer(b *testing.B, ln *InmemoryListener, h fasthttp.RequestHandler, isTLS bool) <-chan struct{} { +func startServer(b *testing.B, ln *fasthttputil.InmemoryListener, h fasthttp.RequestHandler, isTLS bool) <-chan struct{} { ch := make(chan struct{}) go func() { var err error @@ -83,7 +84,7 @@ const ( keyFile = "./ssl-cert-snakeoil.key" ) -func newClient(ln *InmemoryListener, isTLS bool) *fasthttp.HostClient { +func newClient(ln *fasthttputil.InmemoryListener, isTLS bool) *fasthttp.HostClient { return &fasthttp.HostClient{ Dial: func(addr string) (net.Conn, error) { return ln.Dial() |