blob: 96effe5afaec68f5914c4f4bc7992c7bd8b9b015 [file] [log] [blame]
Brad Fitzpatrickf3c01932015-01-15 16:29:16 -08001// 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
5package dashboard
6
7import (
8 "strings"
9 "testing"
10)
11
12func 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}