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 CoreEngine Routing calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  a104956f_49af_a554_1a03_6961f40385d7["testRouteOK()"]
  bb797012_c8d5_c577_dd28_37f3bc2af3da["TestRouterGroupRouteOK()"]
  bb797012_c8d5_c577_dd28_37f3bc2af3da -->|calls| a104956f_49af_a554_1a03_6961f40385d7
  69c2add5_555a_3d82_a4e7_993886631a2c["PerformRequest()"]
  a104956f_49af_a554_1a03_6961f40385d7 -->|calls| 69c2add5_555a_3d82_a4e7_993886631a2c
  style a104956f_49af_a554_1a03_6961f40385d7 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

Frequently Asked Questions

What does testRouteOK() do?
testRouteOK() is a function in the gin codebase.
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