提交单元测试

This commit is contained in:
boyce
2019-03-18 12:58:36 +08:00
parent aeefc6385c
commit 00b66bf24b
2 changed files with 13 additions and 13 deletions

View File

@@ -15,9 +15,9 @@ func TestDBModule(t *testing.T) {
db.Init(100, "192.168.0.5:3306", "root", "Root!!2018", "QuantFundsDB")
db.OnInit()
res := db.Query("select * from tbl_fun_heelthrow where id >= 1")
if res.Err != nil {
t.Error(res.Err)
res, err := db.QueryEx("select * from tbl_fun_heelthrow where id >= 1")
if err != nil {
t.Error(err)
}
out := []struct {
Addtime int64 `json:"addtime"`
@@ -25,15 +25,15 @@ func TestDBModule(t *testing.T) {
Uuid string `json:"uuid,omitempty"`
AAAA string `json:"xxx"`
}{}
err := res.UnMarshal(&out)
err = res.UnMarshal(&out)
if err != nil {
t.Error(err)
}
sres := db.SyncQuery("select * from tbl_fun_heelthrow where id >= 1")
res = sres.Get(2000)
if res.Err != nil {
t.Error(res.Err)
res, err = sres.Get(2000)
if err != nil {
t.Error(err)
}
out2 := []struct {