1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
// Copyright 2015 Daniel Theophanes.
// Use of this source code is governed by a zlib-style
// license that can be found in the LICENSE file.
package service
import (
"runtime"
"strings"
"testing"
)
func TestPlatformName(t *testing.T) {
got := Platform()
t.Logf("Platform is %v", got)
wantPrefix := runtime.GOOS + "-"
// in containers, it will report unix-systemv
wantPrefixContainer := "unix-systemv"
if !strings.HasPrefix(got, wantPrefix) && !strings.HasPrefix(got, wantPrefixContainer) {
t.Errorf("Platform() want: /^%s.*$/, got: %s", wantPrefix, got)
}
}
|