(t *testing.T)
| 517 | } |
| 518 | |
| 519 | func TestFindToolByName(t *testing.T) { |
| 520 | tools := []ServerTool{ |
| 521 | mockTool("issue_read", "toolset1", true), |
| 522 | } |
| 523 | |
| 524 | reg := mustBuild(t, NewBuilder().SetTools(tools)) |
| 525 | |
| 526 | // Find by name |
| 527 | tool, toolsetID, err := reg.FindToolByName("issue_read") |
| 528 | if err != nil { |
| 529 | t.Fatalf("expected no error, got %v", err) |
| 530 | } |
| 531 | if tool.Tool.Name != "issue_read" { |
| 532 | t.Errorf("expected tool name 'issue_read', got '%s'", tool.Tool.Name) |
| 533 | } |
| 534 | if toolsetID != "toolset1" { |
| 535 | t.Errorf("expected toolset ID 'toolset1', got '%s'", toolsetID) |
| 536 | } |
| 537 | |
| 538 | // Non-existent tool |
| 539 | _, _, err = reg.FindToolByName("nonexistent") |
| 540 | if err == nil { |
| 541 | t.Error("expected error for non-existent tool") |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | func TestWithToolsAdditive(t *testing.T) { |
| 546 | tools := []ServerTool{ |
nothing calls this directly
no test coverage detected