(t *testing.T)
| 158 | } |
| 159 | |
| 160 | func TestToolBridge_ParallelCall(t *testing.T) { |
| 161 | registry := tools.NewRegistry() |
| 162 | |
| 163 | registry.Register("SlowTool", func(config map[string]any) (tools.Tool, error) { |
| 164 | return &mockTool{ |
| 165 | name: "SlowTool", |
| 166 | executeFunc: func(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error) { |
| 167 | return map[string]any{"done": true}, nil |
| 168 | }, |
| 169 | }, nil |
| 170 | }) |
| 171 | |
| 172 | bridge := NewToolBridge(registry) |
| 173 | ctx := context.Background() |
| 174 | |
| 175 | calls := []CallToolInput{ |
| 176 | {Name: "SlowTool", Input: nil}, |
| 177 | {Name: "SlowTool", Input: nil}, |
| 178 | {Name: "SlowTool", Input: nil}, |
| 179 | } |
| 180 | |
| 181 | result := bridge.CallToolsParallel(ctx, calls, nil) |
| 182 | |
| 183 | if result.Succeeded != 3 { |
| 184 | t.Errorf("expected 3 succeeded, got %d", result.Succeeded) |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | func TestToolBridge_ListAvailableTools(t *testing.T) { |
| 189 | registry := tools.NewRegistry() |
nothing calls this directly
no test coverage detected