-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
optional_test.go
103 lines (89 loc) · 1.79 KB
/
optional_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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package office_test
import (
"testing"
"go.devnw.com/ooxml"
)
func TestFloat32(t *testing.T) {
exp := float32(1.234)
got := office.Float32(exp)
if *got != exp {
t.Errorf("expected %f, got %f", exp, *got)
}
}
func TestFloat64(t *testing.T) {
exp := 1.234
got := office.Float64(exp)
if *got != exp {
t.Errorf("expected %f, got %f", exp, *got)
}
}
func TestUint64(t *testing.T) {
exp := uint64(123)
got := office.Uint64(exp)
if *got != exp {
t.Errorf("expected %d, got %d", exp, *got)
}
}
func TestUint32(t *testing.T) {
exp := uint32(123)
got := office.Uint32(exp)
if *got != exp {
t.Errorf("expected %d, got %d", exp, *got)
}
}
func TestInt64(t *testing.T) {
exp := int64(123)
got := office.Int64(exp)
if *got != exp {
t.Errorf("expected %d, got %d", exp, *got)
}
}
func TestInt32(t *testing.T) {
exp := int32(123)
got := office.Int32(exp)
if *got != exp {
t.Errorf("expected %d, got %d", exp, *got)
}
}
func TestInt8(t *testing.T) {
exp := int8(123)
got := office.Int8(exp)
if *got != exp {
t.Errorf("expected %d, got %d", exp, *got)
}
}
func TestBool(t *testing.T) {
exp := bool(true)
got := office.Bool(exp)
if *got != exp {
t.Errorf("expected %v, got %v", exp, *got)
}
}
func TestString(t *testing.T) {
exp := "foo"
got := office.String(exp)
if *got != exp {
t.Errorf("expected %s, got %s", exp, *got)
}
}
func TestUint8(t *testing.T) {
exp := uint8(123)
got := office.Uint8(exp)
if *got != exp {
t.Errorf("expected %d, got %d", exp, *got)
}
}
func TestUint16(t *testing.T) {
exp := uint16(123)
got := office.Uint16(exp)
if *got != exp {
t.Errorf("expected %d, got %d", exp, *got)
}
}
func TestStringf(t *testing.T) {
exp := "foobar123"
got := office.Stringf("foo%s%d", "bar", 123)
if *got != exp {
t.Errorf("expected %s, got %s", exp, *got)
}
}