(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func 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 | |
| 69 | func TestSkipOpenLibs(t *testing.T) { |
| 70 | L := NewState(Options{SkipOpenLibs: true}) |
nothing calls this directly
no test coverage detected
searching dependent graphs…