Home / Function/ TestLiteralColonWithHandler() — gin Function Reference

TestLiteralColonWithHandler() — gin Function Reference

Architecture documentation for the TestLiteralColonWithHandler() function in gin_test.go from the gin codebase.

Entity Profile

Relationship Graph

Source Code

gin_test.go lines 1025–1041

func TestLiteralColonWithHandler(t *testing.T) {
	SetMode(TestMode)
	router := New()

	router.GET(`/test\:action`, func(c *Context) {
		c.JSON(http.StatusOK, H{"path": "literal_colon"})
	})

	handler := router.Handler()

	w := httptest.NewRecorder()
	req, _ := http.NewRequest(http.MethodGet, "/test:action", nil)
	handler.ServeHTTP(w, req)

	assert.Equal(t, http.StatusOK, w.Code)
	assert.Contains(t, w.Body.String(), "literal_colon")
}

Domain

Subdomains

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free