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

Function TestParseRepoFromURL

pkg/cli/outcome_eval_test.go:85–102  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

83}
84
85func TestParseRepoFromURL(t *testing.T) {
86 tests := []struct {
87 name string
88 url string
89 expected string
90 }{
91 {"full URL", "https://github.com/owner/repo/pull/42", "owner/repo"},
92 {"issues URL", "https://github.com/github/gh-aw/issues/123", "github/gh-aw"},
93 {"no github", "https://example.com/foo", ""},
94 {"empty", "", ""},
95 }
96
97 for _, tt := range tests {
98 t.Run(tt.name, func(t *testing.T) {
99 assert.Equal(t, tt.expected, parseRepoFromURL(tt.url), "parsed repo from URL")
100 })
101 }
102}
103
104func TestNormalizeRepoForAPI(t *testing.T) {
105 tests := []struct {

Callers

nothing calls this directly

Calls 2

parseRepoFromURLFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected