Files
ThothII/tools/tht/internal/version/info_test.go
T

18 lines
530 B
Go

package version
import (
"runtime"
"testing"
)
// Catches a source build that reports no usable identity or the wrong host platform.
func TestCurrentReportsUsableSourceBuildIdentity(t *testing.T) {
info := Current()
if info.Version == "" || info.Commit == "" || info.BuildTime == "" {
t.Fatalf("Current() = %#v, want non-empty build identity", info)
}
if info.OS != runtime.GOOS || info.Arch != runtime.GOARCH {
t.Fatalf("Current() platform = %s/%s, want %s/%s", info.OS, info.Arch, runtime.GOOS, runtime.GOARCH)
}
}