MCPcopy Create free account
hub / github.com/chanify/chanify / TestLuaGetOptsArray

Function TestLuaGetOptsArray

core/webhook_test.go:233–245  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

231}
232
233func TestLuaGetOptsArray(t *testing.T) {
234 l := lua.NewState()
235 defer l.Close()
236 tbl := l.NewTable()
237 arr := l.NewTable()
238 tbl.RawSetString("a", arr)
239 arr.Append(lua.LNumber(10))
240 arr.Append(lua.LNumber(20))
241 ss := luaGetOptsArray(tbl, "a")
242 if len(ss) != 2 && ss[1] == "20" {
243 t.Error("Check opts array failed")
244 }
245}

Callers

nothing calls this directly

Calls 2

luaGetOptsArrayFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected