| 460 | } |
| 461 | |
| 462 | func Test_Domain_Name(t *testing.T) { |
| 463 | t.Parallel() |
| 464 | |
| 465 | app := New() |
| 466 | |
| 467 | app.Domain("api.example.com").Get("/test", func(c Ctx) error { |
| 468 | return c.SendString("ok") |
| 469 | }).Name("api-test") |
| 470 | |
| 471 | // Verify route was named - by checking routes |
| 472 | var found bool |
| 473 | for _, routes := range app.Stack() { |
| 474 | for _, route := range routes { |
| 475 | if route.Name == "api-test" { |
| 476 | found = true |
| 477 | break |
| 478 | } |
| 479 | } |
| 480 | } |
| 481 | require.True(t, found, "route should be named 'api-test'") |
| 482 | } |
| 483 | |
| 484 | func Test_Domain_NameWithGroup(t *testing.T) { |
| 485 | t.Parallel() |