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

Function TestProtectedCall

vm_test.go:42–52  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

40}
41
42func TestProtectedCall(t *testing.T) {
43 l := NewState()
44 OpenLibraries(l)
45 SetDebugHook(l, func(state *State, ar Debug) {
46 ci := state.callInfo
47 _ = stack(state.stack[ci.base():state.top])
48 _ = ci.code[ci.savedPC].String()
49 }, MaskCount, 1)
50 LoadString(l, "assert(not pcall(bit32.band, {}))")
51 l.Call(0, 0)
52}
53
54func TestLua(t *testing.T) {
55 tests := []struct {

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected