Home / Function/ TestNoRouteWithGlobalHandlers() — gin Function Reference

TestNoRouteWithGlobalHandlers() — gin Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  dd9ef247_c4e6_951d_521b_7c989e9735bf["TestNoRouteWithGlobalHandlers()"]
  5d6e7276_feeb_b8e2_30e8_0ae0827740a5["gin_test.go"]
  dd9ef247_c4e6_951d_521b_7c989e9735bf -->|defined in| 5d6e7276_feeb_b8e2_30e8_0ae0827740a5
  a423cae4_a5e4_5096_1105_5638627a5c35["compareFunc()"]
  dd9ef247_c4e6_951d_521b_7c989e9735bf -->|calls| a423cae4_a5e4_5096_1105_5638627a5c35
  style dd9ef247_c4e6_951d_521b_7c989e9735bf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

gin_test.go lines 494–523

func TestNoRouteWithGlobalHandlers(t *testing.T) {
	var middleware0 HandlerFunc = func(c *Context) {}
	var middleware1 HandlerFunc = func(c *Context) {}
	var middleware2 HandlerFunc = func(c *Context) {}

	router := New()
	router.Use(middleware2)

	router.NoRoute(middleware0)
	assert.Len(t, router.allNoRoute, 2)
	assert.Len(t, router.Handlers, 1)
	assert.Len(t, router.noRoute, 1)

	compareFunc(t, router.Handlers[0], middleware2)
	compareFunc(t, router.noRoute[0], middleware0)
	compareFunc(t, router.allNoRoute[0], middleware2)
	compareFunc(t, router.allNoRoute[1], middleware0)

	router.Use(middleware1)
	assert.Len(t, router.allNoRoute, 3)
	assert.Len(t, router.Handlers, 2)
	assert.Len(t, router.noRoute, 1)

	compareFunc(t, router.Handlers[0], middleware2)
	compareFunc(t, router.Handlers[1], middleware1)
	compareFunc(t, router.noRoute[0], middleware0)
	compareFunc(t, router.allNoRoute[0], middleware2)
	compareFunc(t, router.allNoRoute[1], middleware1)
	compareFunc(t, router.allNoRoute[2], middleware0)
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does TestNoRouteWithGlobalHandlers() do?
TestNoRouteWithGlobalHandlers() is a function in the gin codebase, defined in gin_test.go.
Where is TestNoRouteWithGlobalHandlers() defined?
TestNoRouteWithGlobalHandlers() is defined in gin_test.go at line 494.
What does TestNoRouteWithGlobalHandlers() call?
TestNoRouteWithGlobalHandlers() calls 1 function(s): compareFunc.

Analyze Your Own Codebase

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

Try Supermodel Free