-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathset_basemap_test.go
179 lines (166 loc) · 2.62 KB
/
set_basemap_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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
// Copyright [2020-2023] [guonaihong]
package pcopy
import (
"testing"
"github.com/stretchr/testify/assert"
)
// 生成set_basemap_func.go文件
// func Test_Gen_setBasemap(t *testing.T) {
// err := saveBaseMapFuncToFile("./set_basemap_func.go")
// assert.NoError(t, err)
// }
type PCopyDst_BaseMap struct {
A map[string]string
B map[string]int
C map[string]float64
D map[string]uint
E map[string]uint8
F map[string]uint16
G map[string]uint32
H map[string]uint64
I map[string]bool
J map[string]int8
K map[string]int16
L map[string]int32
M map[string]int64
// N map[string]struct{}
O map[string]float32
// P map[string]complex64
BA int
BB int8
BC int16
BD int32
BE int64
BF uint
BG uint8
BH uint16
BI uint32
BJ uint64
BK bool
BL float32
BM float64
// BN complex64
// BO complex128
CA []int
CB []int8
CC []int16
CD []int32
CE []int64
CF []uint
CG []uint8
CH []uint16
CI []uint32
CJ []uint64
CK []bool
CL []float32
CM []float64
// CN []complex64
// CO []complex128
}
type PCopySrc_BaseMap PCopyDst_BaseMap
var testSrc_BaseMap = PCopySrc_BaseMap{
A: map[string]string{
"1": "1",
"2": "2",
},
B: map[string]int{
"1": 1,
"2": 2,
},
C: map[string]float64{
"1": 1,
"2": 2,
},
D: map[string]uint{
"1": 1,
"2": 2,
},
E: map[string]uint8{
"1": 1,
"2": 2,
},
F: map[string]uint16{
"1": 1,
"2": 2,
},
G: map[string]uint32{
"1": 1,
"2": 2,
},
H: map[string]uint64{
"1": 1,
"2": 2,
},
I: map[string]bool{
"1": true,
"2": false,
},
J: map[string]int8{
"1": 1,
"2": 2,
},
K: map[string]int16{
"1": 1,
"2": 2,
},
L: map[string]int32{
"1": 1,
"2": 2,
},
M: map[string]int64{
"1": 1,
"2": 2,
},
// N: map[string]struct{}{
// "1": struct{}{},
// "2": struct{}{},
// },
O: map[string]float32{
"1": 1,
"2": 2,
},
// P: map[string]complex64{
// "1": 1,
// "2": 2,
// },
BA: 1,
BB: 1,
BC: 1,
BD: 1,
BE: 1,
BF: 1,
BG: 1,
BH: 1,
BI: 1,
BJ: 1,
BK: true,
BL: 1,
BM: 1,
// BN: 1,
// BO: 1,
CA: []int{1, 2},
CB: []int8{1, 2},
CC: []int16{1, 2},
CD: []int32{1, 2},
CE: []int64{1, 2},
CF: []uint{1, 2},
CG: []uint8{1, 2},
CH: []uint16{1, 2},
CI: []uint32{1, 2},
CJ: []uint64{1, 2},
CK: []bool{true, false},
CL: []float32{1, 2},
CM: []float64{1, 2},
// CN: []complex64{1, 2},
// CO: []complex128{1, 2},
}
func Test_SetBaseMap(t *testing.T) {
var dst PCopyDst_BaseMap
err := Preheat(&dst, &testSrc_BaseMap)
dst = PCopyDst_BaseMap{}
assert.NoError(t, err)
err = Copy(&dst, &testSrc_BaseMap, WithUsePreheat())
assert.NoError(t, err)
var dst2 PCopyDst_BaseMap = PCopyDst_BaseMap(testSrc_BaseMap)
assert.Equal(t, dst, dst2)
}