Skip to content

Commit

Permalink
Merge pull request #1094 from kiyonlin/test-case
Browse files Browse the repository at this point in the history
 👷 Add test cases for group router empty prefix path
  • Loading branch information
kiyonlin authored Dec 28, 2020
2 parents d256156 + 2d34c78 commit 0ccccb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,9 @@ func Test_App_Group(t *testing.T) {
grp.All("/ALL", dummyHandler)
testStatus200(t, app, "/test/ALL", MethodPost)

grp.Use(dummyHandler)
testStatus200(t, app, "/test/oke", MethodGet)

grp.Use("/USE", dummyHandler)
testStatus200(t, app, "/test/USE/oke", MethodGet)

Expand Down
3 changes: 3 additions & 0 deletions helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ func Test_Utils_getGroupPath(t *testing.T) {

res = getGroupPath("/v1/api", "group")
utils.AssertEqual(t, "/v1/api/group", res)

res = getGroupPath("/v1/api", "")
utils.AssertEqual(t, "/v1/api", res)
}

// go test -v -run=^$ -bench=Benchmark_Utils_ -benchmem -count=3
Expand Down

0 comments on commit 0ccccb7

Please sign in to comment.