Home / Function/ TestRouterNotFoundWithRemoveExtraSlash() — gin Function Reference

TestRouterNotFoundWithRemoveExtraSlash() — gin Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

routes_test.go lines 545–566

func TestRouterNotFoundWithRemoveExtraSlash(t *testing.T) {
	router := New()
	router.RemoveExtraSlash = true
	router.GET("/path", func(c *Context) {})
	router.GET("/", func(c *Context) {})

	testRoutes := []struct {
		route    string
		code     int
		location string
	}{
		{"/../path", http.StatusOK, ""},    // CleanPath
		{"/nope", http.StatusNotFound, ""}, // NotFound
	}
	for _, tr := range testRoutes {
		w := PerformRequest(router, http.MethodGet, tr.route)
		assert.Equal(t, tr.code, w.Code)
		if w.Code != http.StatusNotFound {
			assert.Equal(t, tr.location, w.Header().Get("Location"))
		}
	}
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does TestRouterNotFoundWithRemoveExtraSlash() do?
TestRouterNotFoundWithRemoveExtraSlash() is a function in the gin codebase, defined in routes_test.go.
Where is TestRouterNotFoundWithRemoveExtraSlash() defined?
TestRouterNotFoundWithRemoveExtraSlash() is defined in routes_test.go at line 545.
What does TestRouterNotFoundWithRemoveExtraSlash() call?
TestRouterNotFoundWithRemoveExtraSlash() calls 1 function(s): PerformRequest.

Analyze Your Own Codebase

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

Try Supermodel Free