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

Function TestParseNumberFromURL

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

Source from the content-addressed store, hash-verified

63}
64
65func TestParseNumberFromURL(t *testing.T) {
66 tests := []struct {
67 name string
68 url string
69 expected int
70 }{
71 {"PR URL", "https://github.com/owner/repo/pull/42", 42},
72 {"issue URL", "https://github.com/owner/repo/issues/108", 108},
73 {"comment URL", "https://github.com/owner/repo/issues/123#issuecomment-456", 123},
74 {"empty", "", 0},
75 {"no number", "https://github.com/owner/repo", 0},
76 }
77
78 for _, tt := range tests {
79 t.Run(tt.name, func(t *testing.T) {
80 assert.Equal(t, tt.expected, parseNumberFromURL(tt.url), "parsed number from URL")
81 })
82 }
83}
84
85func TestParseRepoFromURL(t *testing.T) {
86 tests := []struct {

Callers

nothing calls this directly

Calls 2

parseNumberFromURLFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected