Fix schemagen and test generated code
This commit is contained in:
committed by
Sylwia Szunejko
parent
fcd76082db
commit
653faf1e03
@@ -28,9 +28,9 @@ func TestSchemagen(t *testing.T) {
|
||||
}, ",")
|
||||
*flagIgnoreIndexes = true
|
||||
|
||||
b := runSchemagen(t, "foobar")
|
||||
b := runSchemagen(t, "schemagentest")
|
||||
|
||||
const goldenFile = "testdata/models.go.txt"
|
||||
const goldenFile = "testdata/models.go"
|
||||
if *flagUpdate {
|
||||
if err := ioutil.WriteFile(goldenFile, b, os.ModePerm); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -132,6 +132,7 @@ func createTestSchema(t *testing.T) {
|
||||
title text,
|
||||
album text,
|
||||
artist text,
|
||||
duration duration,
|
||||
tags set<text>,
|
||||
data blob)`)
|
||||
if err != nil {
|
||||
@@ -193,7 +194,9 @@ func runSchemagen(t *testing.T, pkgname string) []byte {
|
||||
t.Fatal(err)
|
||||
}
|
||||
keyspace := "schemagen"
|
||||
cl := "127.0.1.1"
|
||||
|
||||
flagCluster = &cl
|
||||
flagKeyspace = &keyspace
|
||||
flagPkgname = &pkgname
|
||||
flagOutput = &dir
|
||||
|
||||
Reference in New Issue
Block a user