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

Function TestExtractBaseRepo

pkg/workflow/action_resolver_test.go:16–52  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func 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
54func TestActionResolverCache(t *testing.T) {
55 // Create a cache and resolver

Callers

nothing calls this directly

Calls 3

ExtractBaseRepoFunction · 0.92
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected