Home / Function/ testRouteOK() — gin Function Reference

testRouteOK() — gin Function Reference

Architecture documentation for the testRouteOK() function in routes_test.go from the gin codebase.

Function go GinCore Routing calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  1e0a4e8c_1c8a_9ec4_0ee9_9fe0da65b0e9["testRouteOK()"]
  45929e18_70ca_7c55_01e0_596be99dd824["routes_test.go"]
  1e0a4e8c_1c8a_9ec4_0ee9_9fe0da65b0e9 -->|defined in| 45929e18_70ca_7c55_01e0_596be99dd824
  8dabf413_690d_2bc2_8b5e_26c38dde308a["TestRouterGroupRouteOK()"]
  8dabf413_690d_2bc2_8b5e_26c38dde308a -->|calls| 1e0a4e8c_1c8a_9ec4_0ee9_9fe0da65b0e9
  9785c910_0083_377a_37b6_92b299e0e32d["PerformRequest()"]
  1e0a4e8c_1c8a_9ec4_0ee9_9fe0da65b0e9 -->|calls| 9785c910_0083_377a_37b6_92b299e0e32d
  style 1e0a4e8c_1c8a_9ec4_0ee9_9fe0da65b0e9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

routes_test.go lines 35–52

func testRouteOK(method string, t *testing.T) {
	passed := false
	passedAny := false
	r := New()
	r.Any("/test2", func(c *Context) {
		passedAny = true
	})
	r.Handle(method, "/test", func(c *Context) {
		passed = true
	})

	w := PerformRequest(r, method, "/test")
	assert.True(t, passed)
	assert.Equal(t, http.StatusOK, w.Code)

	PerformRequest(r, method, "/test2")
	assert.True(t, passedAny)
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does testRouteOK() do?
testRouteOK() is a function in the gin codebase, defined in routes_test.go.
Where is testRouteOK() defined?
testRouteOK() is defined in routes_test.go at line 35.
What does testRouteOK() call?
testRouteOK() calls 1 function(s): PerformRequest.
What calls testRouteOK()?
testRouteOK() is called by 1 function(s): TestRouterGroupRouteOK.

Analyze Your Own Codebase

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

Try Supermodel Free