MCPcopy Create free account
hub / github.com/yuin/gopher-lua / TestOptTable

Function TestOptTable

auxlib_test.go:241–254  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

239}
240
241func TestOptTable(t *testing.T) {
242 L := NewState()
243 defer L.Close()
244 errorIfGFuncNotFail(t, L, func(L *LState) int {
245 deftbl := L.NewTable()
246 errorIfNotEqual(t, deftbl, L.OptTable(1, deftbl))
247 tbl := L.NewTable()
248 L.Push(tbl)
249 errorIfNotEqual(t, tbl, L.OptTable(2, deftbl))
250 L.Push(LNumber(10))
251 L.OptTable(3, deftbl)
252 return 0
253 }, "table expected, got number")
254}
255
256func TestOptFunction(t *testing.T) {
257 L := NewState()

Callers

nothing calls this directly

Calls 8

errorIfGFuncNotFailFunction · 0.85
errorIfNotEqualFunction · 0.85
LNumberTypeAlias · 0.85
OptTableMethod · 0.80
NewStateFunction · 0.70
PushMethod · 0.65
CloseMethod · 0.45
NewTableMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…