Home / Function/ testRoutes() — gin Function Reference

testRoutes() — gin Function Reference

Architecture documentation for the testRoutes() function in tree_test.go from the gin codebase.

Function go CoreEngine Routing calls 1 called by 5

Entity Profile

Dependency Diagram

graph TD
  c61a6e78_d9c2_827e_4dd0_1dd33dc14e58["testRoutes()"]
  514bce67_730c_570a_040c_7c598650079c["TestTreeWildcardConflict()"]
  514bce67_730c_570a_040c_7c598650079c -->|calls| c61a6e78_d9c2_827e_4dd0_1dd33dc14e58
  54b5b507_fc0b_915a_3995_fd0c9569a807["TestCatchAllAfterSlash()"]
  54b5b507_fc0b_915a_3995_fd0c9569a807 -->|calls| c61a6e78_d9c2_827e_4dd0_1dd33dc14e58
  dc4733bf_5056_e4d8_2afd_c1fb0cb30c40["TestTreeChildConflict()"]
  dc4733bf_5056_e4d8_2afd_c1fb0cb30c40 -->|calls| c61a6e78_d9c2_827e_4dd0_1dd33dc14e58
  4310edfb_a779_311e_cab0_0529fbf6df8c["TestTreeCatchAllConflict()"]
  4310edfb_a779_311e_cab0_0529fbf6df8c -->|calls| c61a6e78_d9c2_827e_4dd0_1dd33dc14e58
  b5f5dbe9_71a4_53ea_8501_8b3890fac480["TestTreeCatchAllConflictRoot()"]
  b5f5dbe9_71a4_53ea_8501_8b3890fac480 -->|calls| c61a6e78_d9c2_827e_4dd0_1dd33dc14e58
  7d17d111_6d55_8539_e0ed_b32eea9e5ef6["catchPanic()"]
  c61a6e78_d9c2_827e_4dd0_1dd33dc14e58 -->|calls| 7d17d111_6d55_8539_e0ed_b32eea9e5ef6
  style c61a6e78_d9c2_827e_4dd0_1dd33dc14e58 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tree_test.go lines 376–392

func testRoutes(t *testing.T, routes []testRoute) {
	tree := &node{}

	for _, route := range routes {
		recv := catchPanic(func() {
			tree.addRoute(route.path, nil)
		})

		if route.conflict {
			if recv == nil {
				t.Errorf("no panic for conflicting route '%s'", route.path)
			}
		} else if recv != nil {
			t.Errorf("unexpected panic for route '%s': %v", route.path, recv)
		}
	}
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does testRoutes() do?
testRoutes() is a function in the gin codebase.
What does testRoutes() call?
testRoutes() calls 1 function(s): catchPanic.
What calls testRoutes()?
testRoutes() is called by 5 function(s): TestCatchAllAfterSlash, TestTreeCatchAllConflict, TestTreeCatchAllConflictRoot, TestTreeChildConflict, TestTreeWildcardConflict.

Analyze Your Own Codebase

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

Try Supermodel Free