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

Function TestCheckFunction

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

Source from the content-addressed store, hash-verified

83}
84
85func TestCheckFunction(t *testing.T) {
86 L := NewState()
87 defer L.Close()
88 errorIfGFuncNotFail(t, L, func(L *LState) int {
89 fn := L.NewFunction(func(l *LState) int { return 0 })
90 L.Push(fn)
91 errorIfNotEqual(t, fn, L.CheckFunction(2))
92 L.Push(LNumber(10))
93 L.CheckFunction(3)
94 return 0
95 }, "function expected, got number")
96}
97
98func TestCheckUserData(t *testing.T) {
99 L := NewState()

Callers

nothing calls this directly

Calls 8

errorIfGFuncNotFailFunction · 0.85
errorIfNotEqualFunction · 0.85
LNumberTypeAlias · 0.85
CheckFunctionMethod · 0.80
NewStateFunction · 0.70
PushMethod · 0.65
CloseMethod · 0.45
NewFunctionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…