Пример #1
0
        public void Can_evaluate_continue_and_evaluate_again()
        {
            var testDebugger = new TestDebuggerFacade();

            testDebugger.Load(@"
sub sub1()
    var x = 33
    x = x + 1
    x = x + 1
end sub");

            testDebugger.AddBreakpoint(4);
            testDebugger.AddBreakpoint(5);
            testDebugger.CallSubrutineAsync("sub1");
            testDebugger.WaitForBreakHit();

            var result = testDebugger.EvaluateExpression("x");

            result.Result.Value.Should().Be(33);

            testDebugger.Continue();
            testDebugger.WaitForBreakHit();

            result = testDebugger.EvaluateExpression("x");
            result.Result.Value.Should().Be(34);

            testDebugger.Continue();

            testDebugger.AssertSubrutineFinished();
        }
Пример #2
0
        public void Can_step_to_next_statement()
        {
            var testDebugger = new TestDebuggerFacade();

            testDebugger.Load(@"
sub sub1()
    var x = 33
    x = x + 1
end sub");

            testDebugger.AddBreakpoint(3);
            testDebugger.CallSubrutineAsync("sub1");
            testDebugger.WaitForBreakHit();

            testDebugger.Step();
            testDebugger.WaitForBreakHit();
            testDebugger.LastBreak?.Location.Line.Should().Be(4);
        }
Пример #3
0
        public void Doesnt_stop_at_empty_line()
        {
            var testDebugger = new TestDebuggerFacade();

            testDebugger.Load(@"
sub sub1()
    var x = 33

    x = x + 1
end sub");

            testDebugger.AddBreakpoint(3);
            testDebugger.CallSubrutineAsync("sub1");
            testDebugger.WaitForBreakHit();

            testDebugger.Step();
            testDebugger.WaitForBreakHit();
            testDebugger.LastBreak?.Location.Line.Should().Be(5);
        }
        public void Breakpoint_works_after_cancellation()
        {
            var testDebugger = new TestDebuggerFacade();

            testDebugger.Load(@"
sub sub1()
    var x = 33
end sub");

            testDebugger.AddBreakpoint(3);
            testDebugger.CallSubrutineAsync("sub1");
            testDebugger.WaitForBreakHit();
            testDebugger.ScriptCancellation.Cancel();
            testDebugger.AssertSubrutineFinished();

            testDebugger.CallSubrutineAsync("sub1");
            testDebugger.WaitForBreakHit();
            testDebugger.Continue();
            testDebugger.AssertSubrutineFinished();
        }
        public void Stops_debugging_when_script_cancelled()
        {
            var testDebugger = new TestDebuggerFacade();

            testDebugger.Load(@"
sub sub1()
    var x = 33
end sub");

            testDebugger.AddBreakpoint(3);
            testDebugger.CallSubrutineAsync("sub1");
            testDebugger.WaitForBreakHit();
            testDebugger.ScriptCancellation.Cancel();
            testDebugger.AssertSubrutineFinished();
        }
Пример #6
0
        public void Can_break_at_statement()
        {
            var testDebugger = new TestDebuggerFacade();

            testDebugger.Load(@"
sub sub1()
    var x = 33
end sub");

            testDebugger.AddBreakpoint(3);
            testDebugger.CallSubrutineAsync("sub1");
            testDebugger.WaitForBreakHit();

            testDebugger.Continue();
            testDebugger.AssertSubrutineFinished();
        }