MCPcopy
hub / github.com/gin-gonic/gin / checkPriorities

Function checkPriorities

tree_test.go:72–90  ·  view source on GitHub ↗
(t *testing.T, n *node)

Source from the content-addressed store, hash-verified

70}
71
72func checkPriorities(t *testing.T, n *node) uint32 {
73 var prio uint32
74 for i := range n.children {
75 prio += checkPriorities(t, n.children[i])
76 }
77
78 if n.handlers != nil {
79 prio++
80 }
81
82 if n.priority != prio {
83 t.Errorf(
84 "priority mismatch for node '%s': is %d, should be %d",
85 n.path, n.priority, prio,
86 )
87 }
88
89 return prio
90}
91
92func TestCountParams(t *testing.T) {
93 if countParams("/path/:param1/static/*catch-all") != 2 {

Callers 3

TestTreeAddAndGetFunction · 0.85
TestTreeWildcardFunction · 0.85
TestUnescapeParametersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected