Skip to content

Commit

Permalink
update RenderTpl test to pass a filepath
Browse files Browse the repository at this point in the history
  • Loading branch information
seemywingz committed May 14, 2024
1 parent 0574b73 commit e4cfc52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion template/tpl_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package template

import (
"path/filepath"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -11,7 +12,8 @@ const (
)

func TestReverse(t *testing.T) {
res, err := RenderTpl([]byte(testTplTemplate), map[string]interface{}{
tplFile := filepath.Join("..", "test", "_simple.tpl")
res, err := RenderTpl(tplFile, map[string]interface{}{
"Template": "template",
})

Expand Down
1 change: 1 addition & 0 deletions test/_simple.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a basic {{ .Template }}

0 comments on commit e4cfc52

Please sign in to comment.