TestTreeDuplicatePath() — gin Function Reference
Architecture documentation for the TestTreeDuplicatePath() function in tree_test.go from the gin codebase.
Entity Profile
Dependency Diagram
graph TD 94c973a8_1f98_3d53_d6fb_d29a986ecc6c["TestTreeDuplicatePath()"] 7d17d111_6d55_8539_e0ed_b32eea9e5ef6["catchPanic()"] 94c973a8_1f98_3d53_d6fb_d29a986ecc6c -->|calls| 7d17d111_6d55_8539_e0ed_b32eea9e5ef6 6dab8d3e_0986_1500_b06f_6323ea7ce91a["fakeHandler()"] 94c973a8_1f98_3d53_d6fb_d29a986ecc6c -->|calls| 6dab8d3e_0986_1500_b06f_6323ea7ce91a 4c07e1ac_0102_9e6b_694c_072ecd891dad["checkRequests()"] 94c973a8_1f98_3d53_d6fb_d29a986ecc6c -->|calls| 4c07e1ac_0102_9e6b_694c_072ecd891dad style 94c973a8_1f98_3d53_d6fb_d29a986ecc6c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tree_test.go lines 457–493
func TestTreeDuplicatePath(t *testing.T) {
tree := &node{}
routes := [...]string{
"/",
"/doc/",
"/src/*filepath",
"/search/:query",
"/user_:name",
}
for _, route := range routes {
recv := catchPanic(func() {
tree.addRoute(route, fakeHandler(route))
})
if recv != nil {
t.Fatalf("panic inserting route '%s': %v", route, recv)
}
// Add again
recv = catchPanic(func() {
tree.addRoute(route, nil)
})
if recv == nil {
t.Fatalf("no panic while inserting duplicate route '%s", route)
}
}
// printChildren(tree, "")
checkRequests(t, tree, testRequests{
{"/", false, "/", nil},
{"/doc/", false, "/doc/", nil},
{"/src/some/file.png", false, "/src/*filepath", Params{Param{"filepath", "/some/file.png"}}},
{"/search/someth!ng+in+ünìcodé", false, "/search/:query", Params{Param{"query", "someth!ng+in+ünìcodé"}}},
{"/user_gopher", false, "/user_:name", Params{Param{"name", "gopher"}}},
})
}
Domain
Subdomains
Source
Frequently Asked Questions
What does TestTreeDuplicatePath() do?
TestTreeDuplicatePath() is a function in the gin codebase.
What does TestTreeDuplicatePath() call?
TestTreeDuplicatePath() calls 3 function(s): catchPanic, checkRequests, fakeHandler.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free