(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func TestClaudeEngineGitHubToolsetsRendering(t *testing.T) { |
| 74 | tests := []struct { |
| 75 | name string |
| 76 | githubTool map[string]any |
| 77 | expectedInYAML []string |
| 78 | notInYAML []string |
| 79 | }{ |
| 80 | { |
| 81 | name: "Toolsets configured with array", |
| 82 | githubTool: map[string]any{ |
| 83 | "toolsets": []string{"repos", "issues", "pull_requests"}, |
| 84 | }, |
| 85 | expectedInYAML: []string{ |
| 86 | `"GITHUB_TOOLSETS": "repos,issues,pull_requests"`, |
| 87 | }, |
| 88 | notInYAML: []string{}, |
| 89 | }, |
| 90 | { |
| 91 | name: "No toolsets configured", |
| 92 | githubTool: map[string]any{}, |
| 93 | expectedInYAML: []string{ |
| 94 | `"GITHUB_PERSONAL_ACCESS_TOKEN"`, |
| 95 | "GITHUB_TOOLSETS", |
| 96 | "context,repos,issues,pull_requests", // defaults to action-friendly toolsets |
| 97 | }, |
| 98 | notInYAML: []string{}, |
| 99 | }, |
| 100 | { |
| 101 | name: "All toolset as array", |
| 102 | githubTool: map[string]any{ |
| 103 | "toolsets": []string{"all"}, |
| 104 | }, |
| 105 | expectedInYAML: []string{ |
| 106 | `"GITHUB_TOOLSETS": "all"`, |
| 107 | }, |
| 108 | notInYAML: []string{}, |
| 109 | }, |
| 110 | { |
| 111 | name: "Default toolset as array - expands to action-friendly", |
| 112 | githubTool: map[string]any{ |
| 113 | "toolsets": []string{"default"}, |
| 114 | }, |
| 115 | expectedInYAML: []string{ |
| 116 | `"GITHUB_TOOLSETS": "context,repos,issues,pull_requests"`, |
| 117 | }, |
| 118 | notInYAML: []string{}, |
| 119 | }, |
| 120 | { |
| 121 | name: "Default with additional toolsets - expands default", |
| 122 | githubTool: map[string]any{ |
| 123 | "toolsets": []string{"default", "discussions"}, |
| 124 | }, |
| 125 | expectedInYAML: []string{ |
| 126 | `"GITHUB_TOOLSETS": "context,repos,issues,pull_requests,discussions"`, |
| 127 | }, |
| 128 | notInYAML: []string{}, |
| 129 | }, |
| 130 | } |
nothing calls this directly
no test coverage detected