forked from mitchellh/gox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
platform_test.go
88 lines (71 loc) · 1.74 KB
/
platform_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package main
import (
"reflect"
"testing"
)
func TestSupportedPlatforms(t *testing.T) {
var ps []Platform
ps = SupportedPlatforms("go1.0")
if !reflect.DeepEqual(ps, Platforms_1_0) {
t.Fatalf("bad: %#v", ps)
}
ps = SupportedPlatforms("go1.1")
if !reflect.DeepEqual(ps, Platforms_1_1) {
t.Fatalf("bad: %#v", ps)
}
ps = SupportedPlatforms("go1.2")
if !reflect.DeepEqual(ps, Platforms_1_1) {
t.Fatalf("bad: %#v", ps)
}
ps = SupportedPlatforms("go1.3")
if !reflect.DeepEqual(ps, Platforms_1_3) {
t.Fatalf("bad: %#v", ps)
}
ps = SupportedPlatforms("go1.4")
if !reflect.DeepEqual(ps, Platforms_1_4) {
t.Fatalf("bad: %#v", ps)
}
ps = SupportedPlatforms("go1.5")
if !reflect.DeepEqual(ps, Platforms_1_5) {
t.Fatalf("bad: %#v", ps)
}
ps = SupportedPlatforms("go1.6")
if !reflect.DeepEqual(ps, Platforms_1_6) {
t.Fatalf("bad: %#v", ps)
}
ps = SupportedPlatforms("go1.7")
if !reflect.DeepEqual(ps, Platforms_1_7) {
t.Fatalf("bad: %#v", ps)
}
ps = SupportedPlatforms("go1.8")
if !reflect.DeepEqual(ps, Platforms_1_8) {
t.Fatalf("bad: %#v", ps)
}
ps = SupportedPlatforms("go1.9")
if !reflect.DeepEqual(ps, Platforms_1_9) {
t.Fatalf("bad: %#v", ps)
}
ps = SupportedPlatforms("go1.10")
if !reflect.DeepEqual(ps, Platforms_1_10) {
t.Fatalf("bad: %#v", ps)
}
// Unknown
ps = SupportedPlatforms("foo")
if !reflect.DeepEqual(ps, PlatformsLatest) {
t.Fatalf("bad: %#v", ps)
}
}
func TestMIPS(t *testing.T) {
g16 := SupportedPlatforms("go1.6")
for _, p := range g16 {
if p.Arch == "mips64" && p.Default {
t.Fatal("mips64 should not be default for 1.6")
}
}
g17 := SupportedPlatforms("go1.7")
for _, p := range g17 {
if p.Arch == "mips64" && !p.Default {
t.Fatal("mips64 should be default for 1.7")
}
}
}