Brad Fitzpatrick | f3c0193 | 2015-01-15 16:29:16 -0800 | [diff] [blame] | 1 | // Copyright 2015 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. |
| 4 | |
| 5 | package dashboard |
| 6 | |
| 7 | import ( |
| 8 | "strings" |
| 9 | "testing" |
| 10 | ) |
| 11 | |
| 12 | func TestOSARCHAccessors(t *testing.T) { |
| 13 | valid := func(s string) bool { return s != "" && !strings.Contains(s, "-") } |
| 14 | for _, conf := range Builders { |
| 15 | os := conf.GOOS() |
| 16 | arch := conf.GOARCH() |
| 17 | osArch := os + "-" + arch |
| 18 | if !valid(os) || !valid(arch) || !(conf.Name == osArch || strings.HasPrefix(conf.Name, osArch+"-")) { |
| 19 | t.Errorf("OS+ARCH(%q) = %q, %q; invalid", conf.Name, os, arch) |
| 20 | } |
| 21 | } |
| 22 | } |