mirror of
https://gitee.com/johng/gf
synced 2026-07-06 13:42:46 +08:00
add more unit testing case for package gview
This commit is contained in:
@ -386,3 +386,17 @@ func Test_BuildInFuncMaps(t *testing.T) {
|
||||
t.Assert(r, ` 0:john 99.9 1:smith 100 `)
|
||||
})
|
||||
}
|
||||
|
||||
func Test_BuildInFuncDump(t *testing.T) {
|
||||
gtest.C(t, func(t *gtest.T) {
|
||||
v := gview.New()
|
||||
v.Assign("v", g.Map{
|
||||
"name": "john",
|
||||
"score": 100,
|
||||
})
|
||||
r, err := v.ParseContent("{{dump .}}")
|
||||
t.Assert(err, nil)
|
||||
t.Assert(gstr.Contains(r, `"name": "john"`), true)
|
||||
t.Assert(gstr.Contains(r, `"score": 100`), true)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user