(t *testing.T)
| 191 | } |
| 192 | |
| 193 | func TestRoutes(t *testing.T) { |
| 194 | GET("/routes-test", func(c *gin.Context) {}) |
| 195 | |
| 196 | routes := Routes() |
| 197 | assert.NotEmpty(t, routes) |
| 198 | |
| 199 | found := false |
| 200 | for _, route := range routes { |
| 201 | if route.Path == "/routes-test" && route.Method == http.MethodGet { |
| 202 | found = true |
| 203 | break |
| 204 | } |
| 205 | } |
| 206 | assert.True(t, found) |
| 207 | } |
| 208 | |
| 209 | func TestSetHTMLTemplate(t *testing.T) { |
| 210 | tmpl := template.Must(template.New("test").Parse("Hello {{.}}")) |