(t *testing.T)
| 235 | } |
| 236 | |
| 237 | func TestRouterGroupRouteAliases(t *testing.T) { |
| 238 | t.Parallel() |
| 239 | |
| 240 | group := RouterGroup[*Event]{} |
| 241 | |
| 242 | testErr := errors.New("test") |
| 243 | |
| 244 | testAction := func(e *Event) error { |
| 245 | return testErr |
| 246 | } |
| 247 | |
| 248 | scenarios := []struct { |
| 249 | route *Route[*Event] |
| 250 | expectMethod string |
| 251 | expectPath string |
| 252 | }{ |
| 253 | { |
| 254 | group.Any("/test", testAction), |
| 255 | "", |
| 256 | "/test", |
| 257 | }, |
| 258 | { |
| 259 | group.GET("/test", testAction), |
| 260 | http.MethodGet, |
| 261 | "/test", |
| 262 | }, |
| 263 | { |
| 264 | group.SEARCH("/test", testAction), |
| 265 | "SEARCH", |
| 266 | "/test", |
| 267 | }, |
| 268 | { |
| 269 | group.POST("/test", testAction), |
| 270 | http.MethodPost, |
| 271 | "/test", |
| 272 | }, |
| 273 | { |
| 274 | group.DELETE("/test", testAction), |
| 275 | http.MethodDelete, |
| 276 | "/test", |
| 277 | }, |
| 278 | { |
| 279 | group.PATCH("/test", testAction), |
| 280 | http.MethodPatch, |
| 281 | "/test", |
| 282 | }, |
| 283 | { |
| 284 | group.PUT("/test", testAction), |
| 285 | http.MethodPut, |
| 286 | "/test", |
| 287 | }, |
| 288 | { |
| 289 | group.HEAD("/test", testAction), |
| 290 | http.MethodHead, |
| 291 | "/test", |
| 292 | }, |
| 293 | { |
| 294 | group.OPTIONS("/test", testAction), |
nothing calls this directly
no test coverage detected
searching dependent graphs…