diff options
| author | Jonathan Amsterdam <jba@google.com> | 2019-09-13 18:02:47 -0400 |
|---|---|---|
| committer | Julie Qiu <julie@golang.org> | 2020-03-27 16:46:43 -0400 |
| commit | b1f1b18463d78f1521597029fa3229df0f68cd49 (patch) | |
| tree | 6ab37abdb28b7c43407b8ce549f48d8de9e9bd31 /internal/stdlib/stdlib_test.go | |
| parent | dada16267bd70fe0509bb694f913f98aa3f94689 (diff) | |
| download | go-x-pkgsite-b1f1b18463d78f1521597029fa3229df0f68cd49.tar.xz | |
stdlib: support rc prereleases
Also, simplify versionForTag by writing a single regexp.
Fixes b/140659468.
Change-Id: I139f833202da450f481075a269f5ee5727e7458a
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/550975
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Diffstat (limited to 'internal/stdlib/stdlib_test.go')
| -rw-r--r-- | internal/stdlib/stdlib_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/stdlib/stdlib_test.go b/internal/stdlib/stdlib_test.go index 90214b1f..ed4d8a7c 100644 --- a/internal/stdlib/stdlib_test.go +++ b/internal/stdlib/stdlib_test.go @@ -35,6 +35,11 @@ func TestTagForVersion(t *testing.T) { want: "go1.13beta1", }, { + name: "std version v1.9.0-rc.2", + version: "v1.9.0-rc.2", + want: "go1.9rc2", + }, + { name: "std with digitless prerelease", version: "v1.13.0-prerelease", want: "go1.13prerelease", @@ -131,6 +136,7 @@ func TestVersions(t *testing.T) { } wants := []string{ "v1.4.2", + "v1.9.0-rc.1", "v1.11.0", "v1.12.9", "v1.13.0", @@ -152,6 +158,9 @@ func TestVersionForTag(t *testing.T) { {"go1.12", "v1.12.0"}, {"go1.9.7", "v1.9.7"}, {"go2.0", "v2.0.0"}, + {"go1.9rc2", "v1.9.0-rc.2"}, + {"go1.1beta", ""}, + {"weekly.2012-02-14", ""}, } { got := versionForTag(tc.in) if got != tc.want { |
