1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-23 19:04:05 +00:00

Merge pull request #1094 from kiyonlin/test-case

👷 Add test cases for group router empty prefix path
This commit is contained in:
kiyon 2020-12-28 13:20:09 +08:00 committed by GitHub
commit 0ccccb733e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -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)

View File

@ -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