(t *testing.T)
| 146 | } |
| 147 | |
| 148 | func TestWithToolsets(t *testing.T) { |
| 149 | tools := []ServerTool{ |
| 150 | mockTool("tool1", "toolset1", true), |
| 151 | mockTool("tool2", "toolset2", true), |
| 152 | mockTool("tool3", "toolset3", true), |
| 153 | } |
| 154 | |
| 155 | // Build with all toolsets |
| 156 | allReg := mustBuild(t, NewBuilder().SetTools(tools).WithToolsets([]string{"all"})) |
| 157 | allTools := allReg.AvailableTools(context.Background()) |
| 158 | if len(allTools) != 3 { |
| 159 | t.Fatalf("Expected 3 tools without filter, got %d", len(allTools)) |
| 160 | } |
| 161 | |
| 162 | // Build with specific toolsets |
| 163 | filteredReg := mustBuild(t, NewBuilder().SetTools(tools).WithToolsets([]string{"toolset1", "toolset3"})) |
| 164 | filteredTools := filteredReg.AvailableTools(context.Background()) |
| 165 | |
| 166 | if len(filteredTools) != 2 { |
| 167 | t.Fatalf("Expected 2 filtered tools, got %d", len(filteredTools)) |
| 168 | } |
| 169 | |
| 170 | // Verify correct tools are included |
| 171 | toolNames := make(map[string]bool) |
| 172 | for _, tool := range filteredTools { |
| 173 | toolNames[tool.Tool.Name] = true |
| 174 | } |
| 175 | if !toolNames["tool1"] || !toolNames["tool3"] { |
| 176 | t.Errorf("Expected tool1 and tool3, got %v", toolNames) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | func TestWithToolsetsTrimsWhitespace(t *testing.T) { |
| 181 | tools := []ServerTool{ |
nothing calls this directly
no test coverage detected