add test info
This commit is contained in:
@@ -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 {
|
||||
|
||||
19
main_test.go
19
main_test.go
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user