-
Notifications
You must be signed in to change notification settings - Fork 9
/
guaxiang_test.go
53 lines (50 loc) · 896 Bytes
/
guaxiang_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
package yi
import (
"testing"
)
func TestGetGuaXiang1(t *testing.T) {
gx := getGuaXiangs()
if len(gx) != 64 {
t.Fatal("not enough", len(gx))
}
for i := range gx {
t.Logf("idx(%+v):%+v", i, gx[i])
}
}
func TestGetGuaXiang(t *testing.T) {
type args struct {
guaIdx string
}
tests := []struct {
name string
args args
want *GuaXiang
}{
// TODO: Add more cases.
{
name: "",
args: args{
guaIdx: "兑艮",
},
want: &GuaXiang{
GuaXu: 31,
ShangShu: 1,
XiaShu: 6,
},
},
}
for _, tt := range tests {
t.Run(
tt.name, func(t *testing.T) {
got := GetGuaXiang(tt.args.guaIdx)
t.Logf("卦象:%+v", got)
if got.ShangShu != tt.want.ShangShu {
t.Errorf("GetGuaXiang() = %v, want %v", got, tt.want)
}
if got.XiaShu != tt.want.XiaShu {
t.Errorf("GetGuaXiang() = %v, want %v", got, tt.want)
}
},
)
}
}