(t *testing.T)
| 83 | } |
| 84 | |
| 85 | func 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 | |
| 104 | func TestNormalizeRepoForAPI(t *testing.T) { |
| 105 | tests := []struct { |
nothing calls this directly
no test coverage detected