TestBashDefaultsConsistency tests that Claude and Copilot engines handle default bash tools consistently
(t *testing.T)
| 9 | |
| 10 | // TestBashDefaultsConsistency tests that Claude and Copilot engines handle default bash tools consistently |
| 11 | func TestBashDefaultsConsistency(t *testing.T) { |
| 12 | compiler := NewCompiler() |
| 13 | claudeEngine := NewClaudeEngine() |
| 14 | copilotEngine := NewCopilotEngine() |
| 15 | |
| 16 | tests := []struct { |
| 17 | name string |
| 18 | tools map[string]any |
| 19 | safeOutputs *SafeOutputsConfig |
| 20 | }{ |
| 21 | { |
| 22 | name: "empty tools, no safe outputs", |
| 23 | tools: map[string]any{}, |
| 24 | safeOutputs: nil, |
| 25 | }, |
| 26 | { |
| 27 | name: "empty tools with create-pull-request safe output", |
| 28 | tools: map[string]any{}, |
| 29 | safeOutputs: &SafeOutputsConfig{ |
| 30 | CreatePullRequests: &CreatePullRequestsConfig{}, |
| 31 | }, |
| 32 | }, |
| 33 | { |
| 34 | name: "bash nil with create-pull-request safe output", |
| 35 | tools: map[string]any{ |
| 36 | "bash": nil, |
| 37 | }, |
| 38 | safeOutputs: &SafeOutputsConfig{ |
| 39 | CreatePullRequests: &CreatePullRequestsConfig{}, |
| 40 | }, |
| 41 | }, |
| 42 | { |
| 43 | name: "bash with star wildcard", |
| 44 | tools: map[string]any{ |
| 45 | "bash": []any{"*"}, |
| 46 | }, |
| 47 | safeOutputs: nil, |
| 48 | }, |
| 49 | { |
| 50 | name: "bash with colon-star wildcard", |
| 51 | tools: map[string]any{ |
| 52 | "bash": []any{":*"}, |
| 53 | }, |
| 54 | safeOutputs: nil, |
| 55 | }, |
| 56 | { |
| 57 | name: "bash with empty array (no tools)", |
| 58 | tools: map[string]any{ |
| 59 | "bash": []any{}, |
| 60 | }, |
| 61 | safeOutputs: nil, |
| 62 | }, |
| 63 | { |
| 64 | name: "bash enabled with true", |
| 65 | tools: map[string]any{ |
| 66 | "bash": true, |
| 67 | }, |
| 68 | safeOutputs: nil, |
nothing calls this directly
no test coverage detected