// script_test
package util

import (
	"log"
	"testing"
)

func Test_script(t *testing.T) {
	lua := LuaScript{Code: "test", Name: "测试"}
	lua.Doc = map[string]interface{}{"title": "测试标题", "detail": "正文"}
	lua.Script = `
		function main(doc)
			local item={}
			item["title"]=doc.title
			item["detail"]=doc.detail
			return item
		end
	`
	rep := lua.RunScript()
	log.Println(rep)
}
