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

Function TestCallStackOverflowWhenAutoGrow

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

Source from the content-addressed store, hash-verified

40}
41
42func TestCallStackOverflowWhenAutoGrow(t *testing.T) {
43 L := NewState(Options{
44 CallStackSize: 3,
45 MinimizeStackMemory: true,
46 })
47 defer L.Close()
48
49 // expect auto growing stack implementation when MinimizeStackMemory is set
50 stack := L.stack
51 if _, ok := stack.(*autoGrowingCallFrameStack); !ok {
52 t.Errorf("expected fixed callframe stack by default")
53 }
54
55 errorIfScriptNotFail(t, L, `
56 local function recurse(count)
57 if count > 0 then
58 recurse(count - 1)
59 end
60 end
61 local function c()
62 print(_printregs())
63 recurse(9)
64 end
65 c()
66 `, "stack overflow")
67}
68
69func TestSkipOpenLibs(t *testing.T) {
70 L := NewState(Options{SkipOpenLibs: true})

Callers

nothing calls this directly

Calls 3

errorIfScriptNotFailFunction · 0.85
NewStateFunction · 0.70
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…