-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrings_test.go
52 lines (45 loc) · 987 Bytes
/
strings_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
package pirev_test
import (
"fmt"
"testing"
. "github.com/antichris/go-pirev"
"github.com/stretchr/testify/require"
)
func TestManufacturer_String(t *testing.T) {
t.Parallel()
for v, want := range map[Manufacturer]string{
0: "Sony UK",
Embest2: "Embest",
^Manufacturer(0): "Manufacturer(255)",
} {
testStringer(t, v, want)
}
}
func TestProcessor_String(t *testing.T) {
t.Parallel()
for v, want := range map[Processor]string{
0: "BCM2835",
BCM2711: "BCM2711",
^Processor(0): "Processor(255)",
} {
testStringer(t, v, want)
}
}
func TestModel_String(t *testing.T) {
t.Parallel()
for v, want := range map[Model]string{
0: "A",
FourB: "4B",
^Model(0): "Model(255)",
} {
testStringer(t, v, want)
}
}
func testStringer(t *testing.T, v fmt.Stringer, want string) bool {
t.Helper()
return t.Run(want, func(t *testing.T) {
t.Helper()
t.Parallel()
require.Equal(t, want, v.String())
})
}