Skip to content

Commit c04ec74

Browse files
committed
route group test
1 parent e09fc86 commit c04ec74

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

group_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package pulse
2+
3+
import "testing"
4+
5+
func TestRouter_Group(t *testing.T) {
6+
router := NewRouter()
7+
api := &Group{
8+
prefix: "/api",
9+
router: router,
10+
}
11+
v1 := api.Group("/v1")
12+
v1.GET("/users", func(ctx *Context) error {
13+
ctx.String("users")
14+
return nil
15+
})
16+
17+
app.Router = router
18+
19+
app.Run(":8083")
20+
}

0 commit comments

Comments
 (0)