MCPcopy Create free account
hub / github.com/devfeel/dotweb / TestGroupSetNotFoundHandleReturnsGroup

Function TestGroupSetNotFoundHandleReturnsGroup

group_test.go:150–161  ·  view source on GitHub ↗

TestGroupSetNotFoundHandleReturnsGroup tests that SetNotFoundHandle returns the Group for chaining

(t *testing.T)

Source from the content-addressed store, hash-verified

148
149// TestGroupSetNotFoundHandleReturnsGroup tests that SetNotFoundHandle returns the Group for chaining
150func TestGroupSetNotFoundHandleReturnsGroup(t *testing.T) {
151 app := New()
152
153 group := app.HttpServer.Group("/api")
154 result := group.SetNotFoundHandle(func(ctx Context) {
155 ctx.WriteString("404")
156 })
157
158 if result == nil {
159 t.Error("SetNotFoundHandle should return Group for chaining")
160 }
161}
162
163// test helper
164type testHttpWriter http.Header

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
GroupMethod · 0.65
SetNotFoundHandleMethod · 0.65
WriteStringMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected