go test -race -run Test_RoutePatternMatch
(t *testing.T)
| 160 | |
| 161 | // go test -race -run Test_RoutePatternMatch |
| 162 | func 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 | |
| 179 | func TestHasPartialMatchBoundary(t *testing.T) { |
| 180 | t.Parallel() |
nothing calls this directly
no test coverage detected