(t *testing.T)
| 19 | } |
| 20 | |
| 21 | func 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 | } |
nothing calls this directly
no test coverage detected