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

Function TestOptInt

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

Source from the content-addressed store, hash-verified

174}
175
176func TestOptInt(t *testing.T) {
177 L := NewState()
178 defer L.Close()
179 errorIfGFuncNotFail(t, L, func(L *LState) int {
180 errorIfNotEqual(t, 99, L.OptInt(1, 99))
181 L.Push(LNumber(10))
182 errorIfNotEqual(t, 10, L.OptInt(2, 99))
183 L.Push(LString("aaa"))
184 L.OptInt(3, 99)
185 return 0
186 }, "number expected, got string")
187}
188
189func TestOptInt64(t *testing.T) {
190 L := NewState()

Callers

nothing calls this directly

Calls 8

errorIfGFuncNotFailFunction · 0.85
errorIfNotEqualFunction · 0.85
LNumberTypeAlias · 0.85
LStringTypeAlias · 0.85
OptIntMethod · 0.80
NewStateFunction · 0.70
PushMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…