在go中使用lua示例, 基于gopher-lua!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
383 B

package crypto
import (
"io/ioutil"
"testing"
lua "github.com/yuin/gopher-lua"
)
func TestApi(t *testing.T) {
data, err := ioutil.ReadFile("../testScript/test_crypto_api.lua")
if err != nil {
t.Fatalf("%s\n", err.Error())
}
state := lua.NewState()
PreLoadGo(state)
if err := state.DoString(string(data)); err != nil {
t.Fatalf("execute test: %s\n", err.Error())
}
}