TestTreeInvalidNodeType() — gin Function Reference
Architecture documentation for the TestTreeInvalidNodeType() function in tree_test.go from the gin codebase.
Entity Profile
Dependency Diagram
graph TD e1e28f36_4494_d9a1_e5ae_c2d58ea0dca9["TestTreeInvalidNodeType()"] 6dab8d3e_0986_1500_b06f_6323ea7ce91a["fakeHandler()"] e1e28f36_4494_d9a1_e5ae_c2d58ea0dca9 -->|calls| 6dab8d3e_0986_1500_b06f_6323ea7ce91a 7d17d111_6d55_8539_e0ed_b32eea9e5ef6["catchPanic()"] e1e28f36_4494_d9a1_e5ae_c2d58ea0dca9 -->|calls| 7d17d111_6d55_8539_e0ed_b32eea9e5ef6 3890ddc0_c7b9_b8d1_7ac9_5fc2030c1b8e["getSkippedNodes()"] e1e28f36_4494_d9a1_e5ae_c2d58ea0dca9 -->|calls| 3890ddc0_c7b9_b8d1_7ac9_5fc2030c1b8e style e1e28f36_4494_d9a1_e5ae_c2d58ea0dca9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tree_test.go lines 874–899
func TestTreeInvalidNodeType(t *testing.T) {
const panicMsg = "invalid node type"
tree := &node{}
tree.addRoute("/", fakeHandler("/"))
tree.addRoute("/:page", fakeHandler("/:page"))
// set invalid node type
tree.children[0].nType = 42
// normal lookup
recv := catchPanic(func() {
tree.getValue("/test", nil, getSkippedNodes(), false)
})
if rs, ok := recv.(string); !ok || rs != panicMsg {
t.Fatalf("Expected panic '"+panicMsg+"', got '%v'", recv)
}
// case-insensitive lookup
recv = catchPanic(func() {
tree.findCaseInsensitivePath("/test", true)
})
if rs, ok := recv.(string); !ok || rs != panicMsg {
t.Fatalf("Expected panic '"+panicMsg+"', got '%v'", recv)
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does TestTreeInvalidNodeType() do?
TestTreeInvalidNodeType() is a function in the gin codebase.
What does TestTreeInvalidNodeType() call?
TestTreeInvalidNodeType() calls 3 function(s): catchPanic, fakeHandler, getSkippedNodes.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free