MCPcopy
hub / github.com/github/github-mcp-server / TestServerToolHandlerPanicOnNil

Function TestServerToolHandlerPanicOnNil

pkg/inventory/registry_test.go:1230–1243  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1228}
1229
1230func TestServerToolHandlerPanicOnNil(t *testing.T) {
1231 tool := ServerTool{
1232 Tool: mcp.Tool{Name: "no_handler"},
1233 Toolset: testToolsetMetadata("toolset1"),
1234 }
1235
1236 defer func() {
1237 if r := recover(); r == nil {
1238 t.Error("Expected Handler() to panic when HandlerFunc is nil")
1239 }
1240 }()
1241
1242 tool.Handler(nil)
1243}
1244
1245// Tests for Enabled function on ServerTool
1246func TestServerToolEnabled(t *testing.T) {

Callers

nothing calls this directly

Calls 3

HandlerMethod · 0.95
testToolsetMetadataFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected