MCPcopy Index your code
hub / github.com/github/github-mcp-server / TestWithToolsetsDeduplicates

Function TestWithToolsetsDeduplicates

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

Source from the content-addressed store, hash-verified

193}
194
195func TestWithToolsetsDeduplicates(t *testing.T) {
196 tools := []ServerTool{
197 mockTool("tool1", "toolset1", true),
198 }
199
200 // Duplicates should be removed
201 filteredReg := mustBuild(t, NewBuilder().SetTools(tools).WithToolsets([]string{"toolset1", "toolset1", " toolset1 "}))
202 filteredTools := filteredReg.AvailableTools(context.Background())
203
204 if len(filteredTools) != 1 {
205 t.Fatalf("Expected 1 tool after deduplication, got %d", len(filteredTools))
206 }
207}
208
209func TestWithToolsetsIgnoresEmptyStrings(t *testing.T) {
210 tools := []ServerTool{

Callers

nothing calls this directly

Calls 6

mustBuildFunction · 0.85
NewBuilderFunction · 0.85
WithToolsetsMethod · 0.80
SetToolsMethod · 0.80
AvailableToolsMethod · 0.80
mockToolFunction · 0.70

Tested by

no test coverage detected