提交 431027ed 编写于 作者: martianzhang's avatar martianzhang

for test coverage

上级 3fa11676
......@@ -19,6 +19,7 @@ package main
import (
"flag"
"fmt"
"os"
"testing"
"github.com/XiaoMi/soar/common"
......@@ -88,8 +89,14 @@ func Test_Main_initQuery(t *testing.T) {
// read from file
initQuery(common.DevPath + "/README.md")
// TODO: read from stdin
// initQuery("")
orgStdin := os.Stdin
tmpStdin, err := os.Open(common.DevPath + "/VERSION")
if err != nil {
t.Error(err)
}
os.Stdin = tmpStdin
fmt.Println(initQuery(""))
os.Stdin = orgStdin
common.Log.Debug("Exiting function: %s", common.GetFunctionName())
}
......
......@@ -160,7 +160,7 @@ func TestStringStorageReq(t *testing.T) {
"char(-1)",
}
err := GoldenDiff(func() {
for name, _ := range CharSets {
for name := range CharSets {
for _, tp := range dataTypes {
fmt.Println(tp, name, StringStorageReq(tp, name))
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册