Home / Function/ TestNoMethodWithGlobalHandlers() — gin Function Reference

TestNoMethodWithGlobalHandlers() — gin Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  a7add9d1_c744_b853_e2e2_34a6fc4e9598["TestNoMethodWithGlobalHandlers()"]
  8319344f_51a7_0885_fb3d_affd8c633546["compareFunc()"]
  a7add9d1_c744_b853_e2e2_34a6fc4e9598 -->|calls| 8319344f_51a7_0885_fb3d_affd8c633546
  style a7add9d1_c744_b853_e2e2_34a6fc4e9598 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

gin_test.go lines 573–602

func TestNoMethodWithGlobalHandlers(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.NoMethod(middleware0)
	assert.Len(t, router.allNoMethod, 2)
	assert.Len(t, router.Handlers, 1)
	assert.Len(t, router.noMethod, 1)

	compareFunc(t, router.Handlers[0], middleware2)
	compareFunc(t, router.noMethod[0], middleware0)
	compareFunc(t, router.allNoMethod[0], middleware2)
	compareFunc(t, router.allNoMethod[1], middleware0)

	router.Use(middleware1)
	assert.Len(t, router.allNoMethod, 3)
	assert.Len(t, router.Handlers, 2)
	assert.Len(t, router.noMethod, 1)

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

Domain

Subdomains

Frequently Asked Questions

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