(t *testing.T)
| 63 | } |
| 64 | |
| 65 | func TestGetEffectiveCopilotGitHubToken(t *testing.T) { |
| 66 | tests := []struct { |
| 67 | name string |
| 68 | customToken string |
| 69 | expected string |
| 70 | }{ |
| 71 | { |
| 72 | name: "custom token has highest precedence", |
| 73 | customToken: "${{ secrets.CUSTOM_COPILOT_TOKEN }}", |
| 74 | expected: "${{ secrets.CUSTOM_COPILOT_TOKEN }}", |
| 75 | }, |
| 76 | { |
| 77 | name: "default fallback for Copilot", |
| 78 | customToken: "", |
| 79 | expected: "${{ secrets.COPILOT_GITHUB_TOKEN }}", |
| 80 | }, |
| 81 | } |
| 82 | |
| 83 | for _, tt := range tests { |
| 84 | t.Run(tt.name, func(t *testing.T) { |
| 85 | result := getEffectiveCopilotRequestsToken(tt.customToken) |
| 86 | if result != tt.expected { |
| 87 | t.Errorf("getEffectiveCopilotRequestsToken() = %q, want %q", result, tt.expected) |
| 88 | } |
| 89 | }) |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | func TestGetEffectiveAgentGitHubToken(t *testing.T) { |
| 94 | tests := []struct { |
nothing calls this directly
no test coverage detected