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

Function TestExtractCommentID

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

Source from the content-addressed store, hash-verified

130}
131
132func TestExtractCommentID(t *testing.T) {
133 tests := []struct {
134 name string
135 url string
136 expected string
137 }{
138 {"issuecomment", "https://github.com/owner/repo/issues/123#issuecomment-456789", "456789"},
139 {"comments path", "https://github.com/owner/repo/issues/comments/789012", "789012"},
140 {"no comment", "https://github.com/owner/repo/issues/123", ""},
141 {"empty", "", ""},
142 }
143
144 for _, tt := range tests {
145 t.Run(tt.name, func(t *testing.T) {
146 assert.Equal(t, tt.expected, extractCommentID(tt.url), "extracted comment ID")
147 })
148 }
149}
150
151func TestResolveItemRepo(t *testing.T) {
152 item := CreatedItemReport{Repo: "explicit/repo"}

Callers

nothing calls this directly

Calls 2

extractCommentIDFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected