-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync_test.go
More file actions
42 lines (39 loc) · 806 Bytes
/
sync_test.go
File metadata and controls
42 lines (39 loc) · 806 Bytes
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
package orm
import (
"github.com/stretchr/testify/require"
"testing"
)
type student struct {
Name string
Age int
ID string
Sex string
}
func Test_Sync(t *testing.T) {
as := require.New(t)
if true {
_d, _err := StructModelInfo(student{})
as.Nil(_err, "writer and read is diff")
as.Equal(4, len(_d))
for _, v := range _d {
t.Logf(`[test-sync-field] %s`, v.Name)
}
}
if true {
_d, _err := StructModelInfoNoPrimary(student{})
as.Nil(_err, "writer and read is diff")
as.Equal(4, len(_d))
for _, v := range _d {
t.Logf(`[test-sync-field] %s`, v.Name)
}
}
if true {
var dl []*student
_d, _err := StructModelInfoByDest(&dl)
as.Nil(_err, "writer and read is diff")
as.Equal(4, len(_d))
for _, v := range _d {
t.Logf(`[test-sync-field] %s`, v.Name)
}
}
}