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

Function TestCheckInt

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

Source from the content-addressed store, hash-verified

6)
7
8func TestCheckInt(t *testing.T) {
9 L := NewState()
10 defer L.Close()
11 errorIfGFuncNotFail(t, L, func(L *LState) int {
12 L.Push(LNumber(10))
13 errorIfNotEqual(t, 10, L.CheckInt(2))
14 L.Push(LString("aaa"))
15 L.CheckInt(3)
16 return 0
17 }, "number expected, got string")
18}
19
20func TestCheckInt64(t *testing.T) {
21 L := NewState()

Callers

nothing calls this directly

Calls 8

errorIfGFuncNotFailFunction · 0.85
LNumberTypeAlias · 0.85
errorIfNotEqualFunction · 0.85
LStringTypeAlias · 0.85
CheckIntMethod · 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…