-
Notifications
You must be signed in to change notification settings - Fork 1
/
constants_test.go
107 lines (93 loc) · 2.22 KB
/
constants_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
104
105
106
107
package bconf_test
import (
"reflect"
"testing"
"time"
"github.com/rheisen/bconf"
)
func TestConstantsMatchReflectKinds(t *testing.T) {
if bconf.Bool != reflect.Bool.String() {
t.Errorf(
"bconf '%s' does not match reflect kind '%s'",
bconf.Bool,
reflect.Bool.String(),
)
}
if bconf.Bools != reflect.TypeOf([]bool{}).String() {
t.Errorf(
"bconf '%s' does not match reflect kind '%s'",
bconf.Bools,
reflect.TypeOf([]bool{}).String(),
)
}
if bconf.String != reflect.String.String() {
t.Errorf(
"bconf '%s' does not match reflect kind '%s'",
bconf.String,
reflect.String.String(),
)
}
if bconf.Strings != reflect.TypeOf([]string{}).String() {
t.Errorf(
"bconf '%s' does not match reflect kind '%s'",
bconf.Strings,
reflect.TypeOf([]string{}).String(),
)
}
if bconf.Int != reflect.Int.String() {
t.Errorf(
"bconf '%s' does not match reflect kind '%s'",
bconf.Int,
reflect.Int.String(),
)
}
if bconf.Ints != reflect.TypeOf([]int{}).String() {
t.Errorf(
"bconf '%s' does not match reflect kind '%s'",
bconf.Ints,
reflect.TypeOf([]int{}).String(),
)
}
if bconf.Float != reflect.Float64.String() {
t.Errorf(
"bconf '%s' does not match reflect kind '%s'",
bconf.Float,
reflect.Float64.String(),
)
}
if bconf.Floats != reflect.TypeOf([]float64{}).String() {
t.Errorf(
"bconf '%s' does not match reflect kind '%s'",
bconf.Ints,
reflect.TypeOf([]float64{}).String(),
)
}
if bconf.Time != reflect.TypeOf(time.Time{}).String() {
t.Errorf(
"bconf '%s' does not match reflect type '%s'",
bconf.Time,
reflect.TypeOf(time.Time{}).String(),
)
}
if bconf.Times != reflect.TypeOf([]time.Time{}).String() {
t.Errorf(
"bconf '%s' does not match reflect kind '%s'",
bconf.Times,
reflect.TypeOf([]time.Time{}).String(),
)
}
if bconf.Duration != reflect.TypeOf(time.Nanosecond).String() {
t.Errorf(
"bconf '%s' does not match reflect type '%s'",
bconf.Duration,
reflect.TypeOf(time.Nanosecond).String(),
)
}
if bconf.Durations != reflect.TypeOf([]time.Duration{}).String() {
t.Errorf(
"bconf '%s' does not match reflect kind '%s'",
bconf.Durations,
reflect.TypeOf([]time.Duration{}).String(),
)
}
}