MCPcopy
hub / github.com/gin-gonic/gin / TestRoutes

Function TestRoutes

ginS/gins_test.go:193–207  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

191}
192
193func 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
209func TestSetHTMLTemplate(t *testing.T) {
210 tmpl := template.Must(template.New("test").Parse("Hello {{.}}"))

Callers

nothing calls this directly

Calls 2

GETFunction · 0.85
RoutesFunction · 0.85

Tested by

no test coverage detected