// Copyright GoFrame Author(https://goframe.org). All Rights Reserved. // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, // You can obtain one at https://github.com/gogf/gf. package gview_test import ( "context" "testing" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/os/gfile" "github.com/gogf/gf/v2/os/gview" "github.com/gogf/gf/v2/test/gtest" ) func Test_Encode_Parse(t *testing.T) { gtest.C(t, func(t *gtest.T) { v := gview.New() v.SetPath(gtest.DataPath("tpl")) v.SetAutoEncode(true) result, err := v.Parse(context.TODO(), "encode.tpl", g.Map{ "title": "my title", }) t.AssertNil(err) t.Assert(result, "