Begun implementing all tests
* Added randomizeStruct * Added under development warning to readme * Restructured the reflection stuff a bit * Added a testmangle.go file for template test functions
This commit is contained in:
parent
019ab3b502
commit
c2541ea56e
12 changed files with 492 additions and 12 deletions
strmangle
22
strmangle/testmangle.go
Normal file
22
strmangle/testmangle.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package strmangle
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/pobri19/sqlboiler/dbdrivers"
|
||||
)
|
||||
|
||||
func RandDBStruct(varName string, table dbdrivers.Table) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func RandDBStructSlice(varName string, num int, table dbdrivers.Table) string {
|
||||
var structs []string
|
||||
for i := 0; i < num; i++ {
|
||||
structs = append(structs, RandDBStruct(varName, table))
|
||||
}
|
||||
|
||||
innerStructs := strings.Join(structs, ",")
|
||||
return fmt.Sprintf("%s := %s{%s}", varName, TitleCasePlural(table.Name), innerStructs)
|
||||
}
|
1
strmangle/testmangle_test.go
Normal file
1
strmangle/testmangle_test.go
Normal file
|
@ -0,0 +1 @@
|
|||
package strmangle
|
Loading…
Add table
Add a link
Reference in a new issue