Home / Function/ TestWithOptionFunc() — gin Function Reference

TestWithOptionFunc() — gin Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

gin_test.go lines 938–953

func TestWithOptionFunc(t *testing.T) {
	r := New()

	r.With(func(e *Engine) {
		e.GET("/test1", handlerTest1)
		e.GET("/test2", handlerTest2)

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

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