
This test case should cover the variant field now, as we have add Variant to default value of spec.platform. Change-Id: I8359007d40a4b8f6a072510fff2ba604a062afa1 Signed-off-by: Wei Chen <Wei.Chen@arm.com> Signed-off-by: Penny Zheng <Penny.Zheng@arm.com>
27 lines
538 B
Go
27 lines
538 B
Go
package platforms
|
|
|
|
import (
|
|
"reflect"
|
|
"runtime"
|
|
"testing"
|
|
|
|
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
|
)
|
|
|
|
func TestDefault(t *testing.T) {
|
|
expected := specs.Platform{
|
|
OS: runtime.GOOS,
|
|
Architecture: runtime.GOARCH,
|
|
Variant: cpuVariant,
|
|
}
|
|
p := DefaultSpec()
|
|
if !reflect.DeepEqual(p, expected) {
|
|
t.Fatalf("default platform not as expected: %#v != %#v", p, expected)
|
|
}
|
|
|
|
s := Default()
|
|
if s != Format(p) {
|
|
t.Fatalf("default specifier should match formatted default spec: %v != %v", s, p)
|
|
}
|
|
}
|