test: unit test for Handlers method in RouterGroup interface

This commit is contained in:
AH-dark 2022-08-23 14:37:17 +08:00
parent 1c1da49bb1
commit 05736c6b1b
No known key found for this signature in database
GPG Key ID: 73D3D212EB75AB80
1 changed files with 1 additions and 0 deletions

View File

@ -178,6 +178,7 @@ func testRoutesInterface(t *testing.T, r IRoutes) {
assert.Equal(t, r, r.Use(handler)) assert.Equal(t, r, r.Use(handler))
assert.Equal(t, r, r.Handle(http.MethodGet, "/handler", handler)) assert.Equal(t, r, r.Handle(http.MethodGet, "/handler", handler))
assert.Equal(t, r, r.Handles([]string{http.MethodGet, http.MethodHead, http.MethodPost}, "/handlers", handler))
assert.Equal(t, r, r.Any("/any", handler)) assert.Equal(t, r, r.Any("/any", handler))
assert.Equal(t, r, r.GET("/", handler)) assert.Equal(t, r, r.GET("/", handler))
assert.Equal(t, r, r.POST("/", handler)) assert.Equal(t, r, r.POST("/", handler))