(t *testing.T)
| 14 | ) |
| 15 | |
| 16 | func TestExtractBaseRepo(t *testing.T) { |
| 17 | tests := []struct { |
| 18 | name string |
| 19 | repo string |
| 20 | expected string |
| 21 | }{ |
| 22 | { |
| 23 | name: "simple repo", |
| 24 | repo: "actions/checkout", |
| 25 | expected: "actions/checkout", |
| 26 | }, |
| 27 | { |
| 28 | name: "repo with subpath", |
| 29 | repo: "github/codeql-action/upload-sarif", |
| 30 | expected: "github/codeql-action", |
| 31 | }, |
| 32 | { |
| 33 | name: "repo with multiple subpaths", |
| 34 | repo: "owner/repo/sub/path", |
| 35 | expected: "owner/repo", |
| 36 | }, |
| 37 | { |
| 38 | name: "single part repo", |
| 39 | repo: "myrepo", |
| 40 | expected: "myrepo", |
| 41 | }, |
| 42 | } |
| 43 | |
| 44 | for _, tt := range tests { |
| 45 | t.Run(tt.name, func(t *testing.T) { |
| 46 | result := gitutil.ExtractBaseRepo(tt.repo) |
| 47 | if result != tt.expected { |
| 48 | t.Errorf("gitutil.ExtractBaseRepo(%q) = %q, want %q", tt.repo, result, tt.expected) |
| 49 | } |
| 50 | }) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | func TestActionResolverCache(t *testing.T) { |
| 55 | // Create a cache and resolver |
nothing calls this directly
no test coverage detected