MCPcopy
hub / github.com/gofiber/fiber / Test_RoutePatternMatch

Function Test_RoutePatternMatch

path_test.go:162–177  ·  view source on GitHub ↗

go test -race -run Test_RoutePatternMatch

(t *testing.T)

Source from the content-addressed store, hash-verified

160
161// go test -race -run Test_RoutePatternMatch
162func Test_RoutePatternMatch(t *testing.T) {
163 t.Parallel()
164 testCaseFn := func(pattern string, cases []routeTestCase) {
165 for _, c := range cases {
166 // skip all cases for partial checks
167 if c.partialCheck {
168 continue
169 }
170 match := RoutePatternMatch(c.url, pattern)
171 require.Equal(t, c.match, match, "route: '%s', url: '%s'", pattern, c.url)
172 }
173 }
174 for _, testCase := range routeTestCases {
175 testCaseFn(testCase.pattern, testCase.testCases)
176 }
177}
178
179func TestHasPartialMatchBoundary(t *testing.T) {
180 t.Parallel()

Callers

nothing calls this directly

Calls 1

RoutePatternMatchFunction · 0.85

Tested by

no test coverage detected