| // Copyright 2018 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| func TestSplitVersion(t *testing.T) { |
| for _, tt := range []struct { |
| major, minor, patch := splitVersion(tt.v) |
| if major != tt.major || minor != tt.minor || patch != tt.patch { |
| t.Errorf("splitVersion(%q) = %v, %v, %v; want %v, %v, %v", |
| tt.v, major, minor, patch, tt.major, tt.minor, tt.patch) |
| func TestSingleFile(t *testing.T) { |
| files, err := ioutil.ReadDir(".") |
| for _, f := range files { |
| if !strings.HasSuffix(f.Name(), "_test.go") && f.Name() != "releaselet.go" { |
| t.Errorf("releaselet should be a single file, found %v", f.Name()) |