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

Function TestWithToolsetsTrimsWhitespace

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

Source from the content-addressed store, hash-verified

178}
179
180func TestWithToolsetsTrimsWhitespace(t *testing.T) {
181 tools := []ServerTool{
182 mockTool("tool1", "toolset1", true),
183 mockTool("tool2", "toolset2", true),
184 }
185
186 // Whitespace should be trimmed
187 filteredReg := mustBuild(t, NewBuilder().SetTools(tools).WithToolsets([]string{" toolset1 ", " toolset2 "}))
188 filteredTools := filteredReg.AvailableTools(context.Background())
189
190 if len(filteredTools) != 2 {
191 t.Fatalf("Expected 2 tools after whitespace trimming, got %d", len(filteredTools))
192 }
193}
194
195func TestWithToolsetsDeduplicates(t *testing.T) {
196 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