(t *testing.T)
| 548 | } |
| 549 | |
| 550 | func TestGenerateAllowedToolsComment(t *testing.T) { |
| 551 | engine := NewClaudeEngine() |
| 552 | |
| 553 | tests := []struct { |
| 554 | name string |
| 555 | allowedToolsStr string |
| 556 | indent string |
| 557 | expected string |
| 558 | }{ |
| 559 | { |
| 560 | name: "empty allowed tools", |
| 561 | allowedToolsStr: "", |
| 562 | indent: " ", |
| 563 | expected: "", |
| 564 | }, |
| 565 | { |
| 566 | name: "single tool", |
| 567 | allowedToolsStr: "Bash", |
| 568 | indent: " ", |
| 569 | expected: " # Allowed tools (sorted):\n # - Bash\n", |
| 570 | }, |
| 571 | { |
| 572 | name: "multiple tools", |
| 573 | allowedToolsStr: "Bash,Edit,Read", |
| 574 | indent: " ", |
| 575 | expected: " # Allowed tools (sorted):\n # - Bash\n # - Edit\n # - Read\n", |
| 576 | }, |
| 577 | { |
| 578 | name: "tools with special characters", |
| 579 | allowedToolsStr: "Bash(echo),mcp__github__issue_read,Write", |
| 580 | indent: " ", |
| 581 | expected: " # Allowed tools (sorted):\n # - Bash(echo)\n # - mcp__github__issue_read\n # - Write\n", |
| 582 | }, |
| 583 | } |
| 584 | |
| 585 | for _, tt := range tests { |
| 586 | t.Run(tt.name, func(t *testing.T) { |
| 587 | result := engine.generateAllowedToolsComment(tt.allowedToolsStr, tt.indent) |
| 588 | if result != tt.expected { |
| 589 | t.Errorf("Expected comment:\n%q\nBut got:\n%q", tt.expected, result) |
| 590 | } |
| 591 | }) |
| 592 | } |
| 593 | } |
nothing calls this directly
no test coverage detected