1 // Copyright 2023 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
9 var parseGoVersionTests = []struct {
13 {"go1.21", version{1, 21}},
14 {"go1.21.0", version{1, 21}},
15 {"go1.21rc2", version{1, 21}},
18 func TestParseGoVersion(t *testing.T) {
19 for _, tt := range parseGoVersionTests {
20 if out, err := parseGoVersion(tt.in); out != tt.out || err != nil {
21 t.Errorf("parseGoVersion(%q) = %v, %v, want %v, nil", tt.in, out, err, tt.out)