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

Function TestCheckString

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

Source from the content-addressed store, hash-verified

44}
45
46func TestCheckString(t *testing.T) {
47 L := NewState()
48 defer L.Close()
49 errorIfGFuncNotFail(t, L, func(L *LState) int {
50 L.Push(LString("aaa"))
51 errorIfNotEqual(t, "aaa", L.CheckString(2))
52 L.Push(LNumber(10))
53 errorIfNotEqual(t, "10", L.CheckString(3))
54 L.Push(L.NewTable())
55 L.CheckString(4)
56 return 0
57 }, "string expected, got table")
58}
59
60func TestCheckBool(t *testing.T) {
61 L := NewState()

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…