-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmodels_test.go
38 lines (35 loc) · 880 Bytes
/
models_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
package resingo
import "testing"
func TestDeviceType(t *testing.T) {
sample := []struct {
typ DeviceType
expect string
}{
{Artik10, "artik10"},
{Artik5, "artik5"},
{BeagleboneBlack, "beaglebone-black"},
{HumingBoard, "hummingboard"},
{IntelAdison, "intel-edison"},
{IntelNuc, "intel-nuc"},
{Nitrogen6x, "nitrogen6x"},
{OdroidC1, "odroid-c1"},
{OdroidXu4, "odroid-xu4"},
{Parallella, "parallella"},
{RaspberryPi, "raspberry-pi"},
{RaspberryPi2, "raspberry-pi2"},
{RaspberryPi3, "raspberrypi3"},
{Ts4900, "ts4900"},
{Ts700, "ts7700"},
{ViaVabx820Quad, "via-vab820-quad"},
{ZyncXz702, "zynq-xz702"},
}
for _, v := range sample {
if v.typ.String() != v.expect {
t.Errorf("expetcted %s got %v", v.expect, v.typ)
}
}
unkown := DeviceType(100)
if unkown.String() != "Unknown" {
t.Errorf("expected Unknown got %v", unkown)
}
}