MCPcopy Create free account
hub / github.com/github/gh-aw / TestComputePolicyHash_CaseInsensitive

Function TestComputePolicyHash_CaseInsensitive

pkg/workflow/cache_integrity_test.go:176–190  ·  view source on GitHub ↗

TestComputePolicyHash_CaseInsensitive verifies that user/repo names are lowercased before hashing.

(t *testing.T)

Source from the content-addressed store, hash-verified

174
175// TestComputePolicyHash_CaseInsensitive verifies that user/repo names are lowercased before hashing.
176func 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.
193func TestCanonicalReposScope(t *testing.T) {

Callers

nothing calls this directly

Calls 1

computePolicyHashFunction · 0.85

Tested by

no test coverage detected