Home / Function/ TestNewOptionFunc() — gin Function Reference

TestNewOptionFunc() — gin Function Reference

Architecture documentation for the TestNewOptionFunc() function in gin_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  7eaba738_b6e6_129d_bbf6_552a3daf37ae["TestNewOptionFunc()"]
  9d1c96e4_2f26_1805_3c63_048a2af89dce["assertRoutePresent()"]
  7eaba738_b6e6_129d_bbf6_552a3daf37ae -->|calls| 9d1c96e4_2f26_1805_3c63_048a2af89dce
  style 7eaba738_b6e6_129d_bbf6_552a3daf37ae fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

gin_test.go lines 921–936

func TestNewOptionFunc(t *testing.T) {
	fc := func(e *Engine) {
		e.GET("/test1", handlerTest1)
		e.GET("/test2", handlerTest2)

		e.Use(func(c *Context) {
			c.Next()
		})
	}

	r := New(fc)

	routes := r.Routes()
	assertRoutePresent(t, routes, RouteInfo{Path: "/test1", Method: http.MethodGet, Handler: "github.com/gin-gonic/gin.handlerTest1"})
	assertRoutePresent(t, routes, RouteInfo{Path: "/test2", Method: http.MethodGet, Handler: "github.com/gin-gonic/gin.handlerTest2"})
}

Domain

Subdomains

Frequently Asked Questions

What does TestNewOptionFunc() do?
TestNewOptionFunc() is a function in the gin codebase.
What does TestNewOptionFunc() call?
TestNewOptionFunc() calls 1 function(s): assertRoutePresent.

Analyze Your Own Codebase

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

Try Supermodel Free