From 9a2da81b11ad0064cca24ce7974827d032309369 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Mon, 1 May 2023 07:56:25 -0600 Subject: name change gus -> sliderule --- router_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'router_test.go') diff --git a/router_test.go b/router_test.go index bfc48bd..5430de7 100644 --- a/router_test.go +++ b/router_test.go @@ -1,4 +1,4 @@ -package gus_test +package sliderule_test import ( "bytes" @@ -9,24 +9,24 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "tildegit.org/tjp/gus" - "tildegit.org/tjp/gus/gemini" + sr "tildegit.org/tjp/sliderule" + "tildegit.org/tjp/sliderule/gemini" ) -var h1 = gus.HandlerFunc(func(_ context.Context, _ *gus.Request) *gus.Response { +var h1 = sr.HandlerFunc(func(_ context.Context, _ *sr.Request) *sr.Response { return gemini.Success("", &bytes.Buffer{}) }) -func mw1(h gus.Handler) gus.Handler { - return gus.HandlerFunc(func(ctx context.Context, req *gus.Request) *gus.Response { +func mw1(h sr.Handler) sr.Handler { + return sr.HandlerFunc(func(ctx context.Context, req *sr.Request) *sr.Response { resp := h.Handle(ctx, req) resp.Body = io.MultiReader(resp.Body, bytes.NewBufferString("\nmiddleware 1")) return resp }) } -func mw2(h gus.Handler) gus.Handler { - return gus.HandlerFunc(func(ctx context.Context, req *gus.Request) *gus.Response { +func mw2(h sr.Handler) sr.Handler { + return sr.HandlerFunc(func(ctx context.Context, req *sr.Request) *sr.Response { resp := h.Handle(ctx, req) resp.Body = io.MultiReader(resp.Body, bytes.NewBufferString("\nmiddleware 2")) return resp @@ -34,7 +34,7 @@ func mw2(h gus.Handler) gus.Handler { } func TestRouterUse(t *testing.T) { - r := &gus.Router{} + r := &sr.Router{} r.Use(mw1) r.Use(mw2) r.Route("/", h1) @@ -52,10 +52,10 @@ func TestRouterUse(t *testing.T) { } func TestRouterMount(t *testing.T) { - outer := &gus.Router{} + outer := &sr.Router{} outer.Use(mw2) - inner := &gus.Router{} + inner := &sr.Router{} inner.Use(mw1) inner.Route("/bar", h1) -- cgit v1.2.3