From d7e6d81e759d15796dd8540b487f824411683afa Mon Sep 17 00:00:00 2001 From: PiterWeb <71133634+PiterWeb@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:54:19 +0200 Subject: [PATCH] More testing coverage in routes --- routes_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/routes_test.go b/routes_test.go index 3bb5881..58c45de 100644 --- a/routes_test.go +++ b/routes_test.go @@ -7,6 +7,24 @@ import ( func TestCreateRouter(t *testing.T) { routes := []Route{ + { + Path: "/", + Method: "get", + Handle: func(ctx *Ctx) error { + ctx.WriteString("I am an index route") + return nil + }, + Children: []Route{ //This will give a warning + { + Path: "/raw", + Method: "get", + Handle: func(ctx *Ctx) error { + ctx.WriteString(BodyResponse) + return nil + }, + }, + }, + }, { Path: "/index", Handle: func(ctx *Ctx) error {