MCPcopy Create free account
hub / github.com/Shopify/goluago / TestPullTableFromLua

Function TestPullTableFromLua

util/deep_pull_test.go:200–225  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

198}
199
200func TestPullTableFromLua(t *testing.T) {
201
202 for _, tt := range fromLuaRecTT {
203 want, code := tt.want, tt.code
204 l := lua.NewState()
205
206 var got interface{}
207 var err error
208
209 l.Register("pullTable", func(l *lua.State) int {
210 got, err = util.PullTable(l, 1)
211 return 0
212 })
213 lua.LoadString(l, code)
214 l.Call(0, 0)
215
216 if err != nil {
217 t.Fatalf("pulling table, %v", err)
218 }
219
220 if !reflect.DeepEqual(want, got) {
221 t.Fatalf("maps are not equal, expected %v, got %v", want, got)
222 }
223 }
224
225}
226
227func TestPullTableWithArraysFromLua(t *testing.T) {
228 require := func(l *lua.State) {

Callers

nothing calls this directly

Calls 1

PullTableFunction · 0.92

Tested by

no test coverage detected