yao/script/script_test.go
2022-11-10 00:10:38 +08:00

23 lines
456 B
Go

package script
import (
"os"
"path"
"testing"
"github.com/stretchr/testify/assert"
"github.com/yaoapp/gou"
"github.com/yaoapp/yao/config"
"github.com/yaoapp/yao/runtime"
)
func init() {
runtime.Load(config.Conf)
rootLib := path.Join(os.Getenv("YAO_DEV"), "/tests/scripts")
LoadFrom(rootLib, "")
}
func TestScript(t *testing.T) {
res, err := gou.Yao.New("time", "hello").Call("world")
assert.Nil(t, err)
assert.Equal(t, "name:world", res)
}