mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
Operation Packification, step 2 of tons. Eventually the buildlet client binary will use this stuff now. Change-Id: I4cf5f3e6beb9e56bdc795ed513ce6daaf61425e3 Reviewed-on: https://go-review.googlesource.com/2921 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
23 lines
616 B
Go
23 lines
616 B
Go
// 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)
|
|
}
|
|
}
|
|
}
|