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

Function TestGitFallbackRequiresNonEmptyRef

pkg/parser/remote_fetch_test.go:54–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestGitFallbackRequiresNonEmptyRef(t *testing.T) {
55 t.Run("all files fallback validates ref", func(t *testing.T) {
56 _, err := listDirAllFilesViaGitForHost("owner", "repo", "", "skills/demo", "")
57 if err == nil {
58 t.Fatal("expected error for empty ref")
59 }
60 if !strings.Contains(err.Error(), "non-empty ref") {
61 t.Fatalf("expected non-empty ref error, got %q", err)
62 }
63 })
64
65 t.Run("subdirs fallback validates ref", func(t *testing.T) {
66 _, err := listDirSubdirsViaGitForHost("owner", "repo", " ", "skills", "")
67 if err == nil {
68 t.Fatal("expected error for empty ref")
69 }
70 if !strings.Contains(err.Error(), "non-empty ref") {
71 t.Fatalf("expected non-empty ref error, got %q", err)
72 }
73 })
74}
75
76func TestListContentsRecursivelyWithDepth_MaxDepthGuard(t *testing.T) {
77 _, err := listContentsRecursivelyWithDepth(nil, "owner", "repo", "main", "skills/demo/deep", 11, 10)

Callers

nothing calls this directly

Calls 4

RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected