MCPcopy
hub / github.com/expr-lang/expr / TestDebugger

Function TestDebugger

vm/debug_test.go:16–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestDebugger(t *testing.T) {
17 input := `[1, 2]`
18
19 node, err := parser.Parse(input)
20 require.NoError(t, err)
21
22 program, err := compiler.Compile(node, nil)
23 require.NoError(t, err)
24
25 debug := vm.Debug()
26 go func() {
27 debug.Step()
28 debug.Step()
29 debug.Step()
30 debug.Step()
31 }()
32 go func() {
33 for range debug.Position() {
34 }
35 }()
36
37 _, err = debug.Run(program, nil)
38 require.NoError(t, err)
39 require.Len(t, debug.Stack, 0)
40 require.Nil(t, debug.Scopes)
41}

Callers

nothing calls this directly

Calls 9

ParseFunction · 0.92
NoErrorFunction · 0.92
CompileFunction · 0.92
DebugFunction · 0.92
LenFunction · 0.92
NilFunction · 0.92
StepMethod · 0.80
PositionMethod · 0.80
RunMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…