MCPcopy
hub / github.com/gofiber/fiber / Test_Hook_OnGroup

Function Test_Hook_OnGroup

hooks_test.go:103–120  ·  hooks_test.go::Test_Hook_OnGroup
(t *testing.T)

Source from the content-addressed store, hash-verified

101}
102
103func Test_Hook_OnGroup(t *testing.T) {
104 t.Parallel()
105 app := New()
106
107 buf := bytebufferpool.Get()
108 defer bytebufferpool.Put(buf)
109
110 app.Hooks().OnGroup(func(g Group) error {
111 _, err := buf.WriteString(g.Prefix)
112 require.NoError(t, err)
113 return nil
114 })
115
116 grp := app.Group("/x").Name("x.")
117 grp.Group("/a")
118
119 require.Equal(t, "/x/x/a", buf.String())
120}
121
122func Test_Hook_OnGroup_Mount(t *testing.T) {
123 t.Parallel()

Callers

nothing calls this directly

Calls 9

OnGroupMethod · 0.80
HooksMethod · 0.80
NewFunction · 0.70
GetMethod · 0.65
PutMethod · 0.65
WriteStringMethod · 0.65
NameMethod · 0.65
GroupMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected