MCPcopy Index your code
hub / github.com/Shopify/go-lua / testStringHelper

Function testStringHelper

vm_test.go:27–40  ·  view source on GitHub ↗
(t *testing.T, s string, trace bool)

Source from the content-addressed store, hash-verified

25}
26
27func testStringHelper(t *testing.T, s string, trace bool) {
28 l := NewState()
29 OpenLibraries(l)
30 LoadString(l, s)
31 if trace {
32 SetDebugHook(l, func(state *State, ar Debug) {
33 ci := state.callInfo
34 p := state.prototype(ci)
35 println(stack(state.stack[ci.base():state.top]))
36 println(ci.code[ci.savedPC].String(), p.source, p.lineInfo[ci.savedPC])
37 }, MaskCount, 1)
38 }
39 l.Call(0, 0)
40}
41
42func TestProtectedCall(t *testing.T) {
43 l := NewState()

Callers 2

testStringFunction · 0.85
testNoPanicStringFunction · 0.85

Calls 9

CallMethod · 0.95
NewStateFunction · 0.85
OpenLibrariesFunction · 0.85
LoadStringFunction · 0.85
SetDebugHookFunction · 0.85
stackFunction · 0.85
prototypeMethod · 0.80
baseMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected