TestComputePolicyHash_CaseInsensitive verifies that user/repo names are lowercased before hashing.
(t *testing.T)
| 174 | |
| 175 | // TestComputePolicyHash_CaseInsensitive verifies that user/repo names are lowercased before hashing. |
| 176 | func TestComputePolicyHash_CaseInsensitive(t *testing.T) { |
| 177 | cfg1 := &GitHubToolConfig{ |
| 178 | MinIntegrity: GitHubIntegrityNone, |
| 179 | AllowedRepos: []any{"GitHub/GH-AW"}, |
| 180 | BlockedUsers: []string{"Alice"}, |
| 181 | } |
| 182 | cfg2 := &GitHubToolConfig{ |
| 183 | MinIntegrity: GitHubIntegrityNone, |
| 184 | AllowedRepos: []any{"github/gh-aw"}, |
| 185 | BlockedUsers: []string{"alice"}, |
| 186 | } |
| 187 | |
| 188 | assert.Equal(t, computePolicyHash(cfg1), computePolicyHash(cfg2), |
| 189 | "Policy hash must be case-insensitive for user and repo names") |
| 190 | } |
| 191 | |
| 192 | // TestCanonicalReposScope verifies canonical forms for all repo scope types. |
| 193 | func TestCanonicalReposScope(t *testing.T) { |
nothing calls this directly
no test coverage detected