Home / Function/ TestRouteRawPathNoUnescape() — gin Function Reference

TestRouteRawPathNoUnescape() — gin Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  b702acc8_aa46_56e5_18b6_c24f701fb9fe["TestRouteRawPathNoUnescape()"]
  69c2add5_555a_3d82_a4e7_993886631a2c["PerformRequest()"]
  b702acc8_aa46_56e5_18b6_c24f701fb9fe -->|calls| 69c2add5_555a_3d82_a4e7_993886631a2c
  style b702acc8_aa46_56e5_18b6_c24f701fb9fe fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

routes_test.go lines 699–717

func TestRouteRawPathNoUnescape(t *testing.T) {
	route := New()
	route.UseRawPath = true
	route.UnescapePathValues = false

	route.POST("/project/:name/build/:num", func(c *Context) {
		name := c.Params.ByName("name")
		num := c.Params.ByName("num")

		assert.Equal(t, name, c.Param("name"))
		assert.Equal(t, num, c.Param("num"))

		assert.Equal(t, "Some%2FOther%2FProject", name)
		assert.Equal(t, "333", num)
	})

	w := PerformRequest(route, http.MethodPost, "/project/Some%2FOther%2FProject/build/333")
	assert.Equal(t, http.StatusOK, w.Code)
}

Domain

Subdomains

Frequently Asked Questions

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