Home / Function/ testRouteNotOK2() — gin Function Reference

testRouteNotOK2() — gin Function Reference

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

Function go CoreEngine Routing calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  ba098d85_3d0d_41fb_1df7_0ada76eebbc7["testRouteNotOK2()"]
  71f3c246_0c1f_b9f8_d8bd_a681ebe3e9d0["TestRouteNotOK2()"]
  71f3c246_0c1f_b9f8_d8bd_a681ebe3e9d0 -->|calls| ba098d85_3d0d_41fb_1df7_0ada76eebbc7
  69c2add5_555a_3d82_a4e7_993886631a2c["PerformRequest()"]
  ba098d85_3d0d_41fb_1df7_0ada76eebbc7 -->|calls| 69c2add5_555a_3d82_a4e7_993886631a2c
  style ba098d85_3d0d_41fb_1df7_0ada76eebbc7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

routes_test.go lines 69–87

func testRouteNotOK2(method string, t *testing.T) {
	passed := false
	router := New()
	router.HandleMethodNotAllowed = true
	var methodRoute string
	if method == http.MethodPost {
		methodRoute = http.MethodGet
	} else {
		methodRoute = http.MethodPost
	}
	router.Handle(methodRoute, "/test", func(c *Context) {
		passed = true
	})

	w := PerformRequest(router, method, "/test")

	assert.False(t, passed)
	assert.Equal(t, http.StatusMethodNotAllowed, w.Code)
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does testRouteNotOK2() do?
testRouteNotOK2() is a function in the gin codebase.
What does testRouteNotOK2() call?
testRouteNotOK2() calls 1 function(s): PerformRequest.
What calls testRouteNotOK2()?
testRouteNotOK2() is called by 1 function(s): TestRouteNotOK2.

Analyze Your Own Codebase

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

Try Supermodel Free