mirror of
https://github.com/foolin/goview.git
synced 2025-09-27 03:06:23 +08:00
add test case
This commit is contained in:
@@ -1 +1 @@
|
||||
{{echo .Name}}
|
||||
{{echo .name}}
|
1
_examples/test/include.tpl
Normal file
1
_examples/test/include.tpl
Normal file
@@ -0,0 +1 @@
|
||||
{{define "content"}}{{include "widgets/inc"}}{{end}}
|
1
_examples/test/widgets/inc.tpl
Normal file
1
_examples/test/widgets/inc.tpl
Normal file
@@ -0,0 +1 @@
|
||||
Inc{{.name}}
|
15
view_test.go
15
view_test.go
@@ -11,6 +11,16 @@ var cases = []struct {
|
||||
Data M
|
||||
Out string
|
||||
}{
|
||||
{
|
||||
Name: "echo.tpl",
|
||||
Data: M{"name": "GoView"},
|
||||
Out: "$GoView",
|
||||
},
|
||||
{
|
||||
Name: "include",
|
||||
Data: M{"name": "GoView"},
|
||||
Out: "<v>IncGoView</v>",
|
||||
},
|
||||
{
|
||||
Name: "index",
|
||||
Data: M{},
|
||||
@@ -27,11 +37,6 @@ var cases = []struct {
|
||||
},
|
||||
Out: "<v>3</v>",
|
||||
},
|
||||
{
|
||||
Name: "echo.tpl",
|
||||
Data: M{"Name": "GoView"},
|
||||
Out: "$GoView",
|
||||
},
|
||||
}
|
||||
|
||||
func TestViewEngine_RenderWriter(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user