MCPcopy Index your code
hub / github.com/yuin/gopher-lua / TestToFunction

Function TestToFunction

state_test.go:220–229  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

218}
219
220func TestToFunction(t *testing.T) {
221 L := NewState()
222 defer L.Close()
223 L.Push(LNumber(10))
224 L.Push(LString("99.9"))
225 L.Push(L.NewFunction(func(L *LState) int { return 0 }))
226 errorIfFalse(t, L.ToFunction(1) == nil, "index 1 must be nil")
227 errorIfFalse(t, L.ToFunction(2) == nil, "index 2 must be nil")
228 errorIfNotEqual(t, L.Get(3), L.ToFunction(3))
229}
230
231func TestToUserData(t *testing.T) {
232 L := NewState()

Callers

nothing calls this directly

Calls 10

LNumberTypeAlias · 0.85
LStringTypeAlias · 0.85
errorIfFalseFunction · 0.85
errorIfNotEqualFunction · 0.85
NewStateFunction · 0.70
PushMethod · 0.65
CloseMethod · 0.45
NewFunctionMethod · 0.45
ToFunctionMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…