Home / Function/ TestEscapedColon() — gin Function Reference

TestEscapedColon() — gin Function Reference

Architecture documentation for the TestEscapedColon() function in gin_integration_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  7267e09f_e1ec_2d89_0393_cd8ac5103ed3["TestEscapedColon()"]
  076d326a_acfa_c808_1141_d1324fc6e43a["gin_integration_test.go"]
  7267e09f_e1ec_2d89_0393_cd8ac5103ed3 -->|defined in| 076d326a_acfa_c808_1141_d1324fc6e43a
  28a99f08_7707_75d8_4467_709023cd3fc2["testRequest()"]
  7267e09f_e1ec_2d89_0393_cd8ac5103ed3 -->|calls| 28a99f08_7707_75d8_4467_709023cd3fc2
  style 7267e09f_e1ec_2d89_0393_cd8ac5103ed3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

gin_integration_test.go lines 584–607

func TestEscapedColon(t *testing.T) {
	router := New()
	f := func(u string) {
		router.GET(u, func(c *Context) { c.String(http.StatusOK, u) })
	}
	f("/r/r\\:r")
	f("/r/r:r")
	f("/r/r/:r")
	f("/r/r/\\:r")
	f("/r/r/r\\:r")
	assert.Panics(t, func() {
		f("\\foo:")
	})

	router.updateRouteTrees()
	ts := httptest.NewServer(router)
	defer ts.Close()

	testRequest(t, ts.URL+"/r/r123", "", "/r/r:r")
	testRequest(t, ts.URL+"/r/r:r", "", "/r/r\\:r")
	testRequest(t, ts.URL+"/r/r/r123", "", "/r/r/:r")
	testRequest(t, ts.URL+"/r/r/:r", "", "/r/r/\\:r")
	testRequest(t, ts.URL+"/r/r/r:r", "", "/r/r/r\\:r")
}

Domain

Subdomains

Frequently Asked Questions

What does TestEscapedColon() do?
TestEscapedColon() is a function in the gin codebase, defined in gin_integration_test.go.
Where is TestEscapedColon() defined?
TestEscapedColon() is defined in gin_integration_test.go at line 584.
What does TestEscapedColon() call?
TestEscapedColon() calls 1 function(s): testRequest.

Analyze Your Own Codebase

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

Try Supermodel Free