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

Function TestToNumber

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

Source from the content-addressed store, hash-verified

185}
186
187func TestToNumber(t *testing.T) {
188 L := NewState()
189 defer L.Close()
190 L.Push(LNumber(10))
191 L.Push(LString("99.9"))
192 L.Push(L.NewTable())
193 errorIfNotEqual(t, LNumber(10), L.ToNumber(1))
194 errorIfNotEqual(t, LNumber(99.9), L.ToNumber(2))
195 errorIfNotEqual(t, LNumber(0), L.ToNumber(3))
196}
197
198func TestToString(t *testing.T) {
199 L := NewState()

Callers

nothing calls this directly

Calls 8

LNumberTypeAlias · 0.85
LStringTypeAlias · 0.85
errorIfNotEqualFunction · 0.85
NewStateFunction · 0.70
PushMethod · 0.65
CloseMethod · 0.45
NewTableMethod · 0.45
ToNumberMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…