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

Function TestOptString

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

Source from the content-addressed store, hash-verified

213}
214
215func TestOptString(t *testing.T) {
216 L := NewState()
217 defer L.Close()
218 errorIfGFuncNotFail(t, L, func(L *LState) int {
219 errorIfNotEqual(t, "bbb", L.OptString(1, "bbb"))
220 L.Push(LString("aaa"))
221 errorIfNotEqual(t, "aaa", L.OptString(2, "bbb"))
222 L.Push(LNumber(10))
223 L.OptString(3, "bbb")
224 return 0
225 }, "string expected, got number")
226}
227
228func TestOptBool(t *testing.T) {
229 L := NewState()

Callers

nothing calls this directly

Calls 8

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