// Copyright 2015 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. package dashboard import ( "strings" "testing" ) func TestOSARCHAccessors(t *testing.T) { valid := func(s string) bool { return s != "" && !strings.Contains(s, "-") } for _, conf := range Builders { os := conf.GOOS() arch := conf.GOARCH() osArch := os + "-" + arch if !valid(os) || !valid(arch) || !(conf.Name == osArch || strings.HasPrefix(conf.Name, osArch+"-")) { t.Errorf("OS+ARCH(%q) = %q, %q; invalid", conf.Name, os, arch) } } }