MCPcopy Create free account
hub / github.com/cli/cli / TestChangelogURL

Function TestChangelogURL

pkg/cmd/version/version_test.go:21–56  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19}
20
21func TestChangelogURL(t *testing.T) {
22 tag := "0.3.2"
23 url := "https://github.com/cli/cli/releases/tag/v0.3.2"
24 result := changelogURL(tag)
25 if result != url {
26 t.Errorf("expected %s to create url %s but got %s", tag, url, result)
27 }
28
29 tag = "v0.3.2"
30 url = "https://github.com/cli/cli/releases/tag/v0.3.2"
31 result = changelogURL(tag)
32 if result != url {
33 t.Errorf("expected %s to create url %s but got %s", tag, url, result)
34 }
35
36 tag = "0.3.2-pre.1"
37 url = "https://github.com/cli/cli/releases/tag/v0.3.2-pre.1"
38 result = changelogURL(tag)
39 if result != url {
40 t.Errorf("expected %s to create url %s but got %s", tag, url, result)
41 }
42
43 tag = "0.3.5-90-gdd3f0e0"
44 url = "https://github.com/cli/cli/releases/latest"
45 result = changelogURL(tag)
46 if result != url {
47 t.Errorf("expected %s to create url %s but got %s", tag, url, result)
48 }
49
50 tag = "deadbeef"
51 url = "https://github.com/cli/cli/releases/latest"
52 result = changelogURL(tag)
53 if result != url {
54 t.Errorf("expected %s to create url %s but got %s", tag, url, result)
55 }
56}

Callers

nothing calls this directly

Calls 2

changelogURLFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected