Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
page fix
  • Loading branch information
msbu-bot committed Feb 1, 2016
1 parent 2105ecc commit 42ab874
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion page/page.go
Expand Up @@ -47,8 +47,11 @@ func (page *Page) setEngine(g generator.Generator) {
page.engine = g
}

func (page *Page) loadRaw() {
}

func (page *Page) generate() (bool, []byte) {
page.engine.SetTemplate(page.content)
page.engine.SetTemplate([]byte(`# hello`))
if !page.engine.Render(page.variables) {
return false, []byte(``)
}
Expand Down
8 changes: 4 additions & 4 deletions page/page_test.go
Expand Up @@ -8,13 +8,13 @@ import (
"github.com/crispgm/go-spg/variables"
)

func TestNewWithStatic(t *testing.T){
func TestNewWithMdx(t *testing.T){
var jsonBlob = []byte(`{"Value": "Monotremata"}`)
vrb := variables.New(jsonBlob)

page := Page{"", "", []byte(``), vrb, generator.G_STATIC, nil}
if page.gtype != generator.G_STATIC {
t.Error("Test GetIntVar failed")
page := Page{"", "", []byte(``), vrb, generator.G_MDX, nil}
if page.gtype != generator.G_MDX {
t.Error("Test NewMdx failed")
}
fmt.Println(page.generate())
}

0 comments on commit 42ab874

Please sign in to comment.