add test info

This commit is contained in:
谢小军
2019-12-31 16:12:37 +08:00
parent 617b01e600
commit ed989232f6
3 changed files with 22 additions and 2 deletions

View File

@@ -21,6 +21,10 @@ func Execute() {
modeldb := GetMysqlModel()
pkg := modeldb.GenModel()
// just for test
// out, _ := json.Marshal(pkg)
// tools.WriteFile("test.txt", []string{string(out)}, true)
list := model.Generate(pkg)
for _, v := range list {

View File

@@ -1,11 +1,26 @@
package main
import (
"encoding/json"
"fmt"
"testing"
"github.com/xxjwxc/gormt/data/cmd"
"github.com/xxjwxc/public/tools"
"github.com/xxjwxc/gormt/data/view/model"
)
func TestDomain(t *testing.T) {
cmd.Execute()
strjson := tools.ReadFile("test.txt")
var str string
for _, v := range strjson {
str += v
}
var pkg model.DBInfo
json.Unmarshal([]byte(str), &pkg)
// out, _ := json.Marshal(pkg)
// tools.WriteFile("test.txt", []string{string(out)}, true)
list := model.Generate(pkg)
fmt.Println(list)
}

1
test.txt Normal file

File diff suppressed because one or more lines are too long