Added main template test file, fixed errors

* Fixed TestTemplates bug (now shows compile errors properly)
* Fixed all compile errors for templates (except test templates)
* Added conditional imports for column types
This commit is contained in:
Patrick O'brien 2016-03-23 13:03:35 +10:00
commit 48a9ba8d29
13 changed files with 242 additions and 57 deletions

View file

@ -61,12 +61,15 @@ func TestTemplates(t *testing.T) {
}
defer tplTestHandle.Close()
fmt.Fprintf(tplTestHandle, "package %s", cmdData.PkgName)
fmt.Fprintf(tplTestHandle, "package %s\n", cmdData.PkgName)
buf := bytes.Buffer{}
cmd := exec.Command("go", "test", tplFile)
buf2 := bytes.Buffer{}
cmd := exec.Command("go", "test")
cmd.Dir = cmdData.OutFolder
cmd.Stderr = &buf
cmd.Stdout = &buf2
if err = cmd.Run(); err != nil {
t.Errorf("go test cmd execution failed: %s\n\n%s", err, buf.String())