forked from babyname/fate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fate_test.go
52 lines (48 loc) · 1.08 KB
/
fate_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 fate_test
import (
"context"
"github.com/godcong/chronos"
"github.com/godcong/fate"
"github.com/godcong/fate/config"
"testing"
)
func init() {
//trait.NewZapFileSugar("fate.log")
}
func TestFate_RunMakeName(t *testing.T) {
born := chronos.New("2020/02/06 15:45").Solar().Time()
last := "张"
cfg := config.DefaultConfig()
cfg.BaguaFilter = true
cfg.ZodiacFilter = true
cfg.SupplyFilter = true
cfg.HardFilter = true
cfg.StrokeMin = 3
cfg.StrokeMax = 24
cfg.Regular = true
cfg.RunInit = false
cfg.FileOutput = config.FileOutput{
OutputMode: config.OutputModeLog,
Path: "name.log",
}
cfg.Database = config.Database{
Host: "localhost",
Port: "3306",
User: "root",
Pwd: "111111",
Name: "fate",
MaxIdleCon: 0,
MaxOpenCon: 0,
Driver: "mysql",
File: "",
Dsn: "",
ShowSQL: false,
ShowExecTime: false,
}
f := fate.NewFate(last, born, fate.ConfigOption(cfg), fate.SexOption(fate.SexGirl))
//f.SetDB(eng)
e := f.MakeName(context.Background())
if e != nil {
t.Fatal(e)
}
}