Exemple #1
0
        public async Task Representation(string expr, string deparse, string str, string toString)
        {
            using (var debugSession = new DebugSession(_session)) {
                var res  = (await debugSession.EvaluateAsync(expr)).Should().BeAssignableTo <DebugValueEvaluationResult>().Which;
                var repr = res.GetRepresentation();

                repr.Deparse.Should().Be(deparse);
                repr.Str.Should().Be(str);
                repr.ToString.Should().Be(toString);
            }
        }
Exemple #2
0
        public async Task SetBreakpointOnNull()
        {
            const string code =
                @"f <- function() {
    NULL
  }";

            using (var debugSession = new DebugSession(_session))
                using (var sf = new SourceFile(code)) {
                    var bp = await debugSession.CreateBreakpointAsync(new DebugBreakpointLocation(sf.FilePath, 2));

                    debugSession.Breakpoints.Count.Should().Be(1);

                    await sf.Source(_session);

                    var res = (await debugSession.EvaluateAsync("is.function(f)", DebugEvaluationResultFields.ReprDeparse)).As <DebugValueEvaluationResult>();
                    res.GetRepresentation().Deparse
                    .Should().Be("TRUE");
                }
        }
Exemple #3
0
        public async Task SetBreakpointOnNull() {
            const string code =
@"f <- function() {
    NULL
  }";

            using (var debugSession = new DebugSession(_session))
            using (var sf = new SourceFile(code)) {
                var bp = await debugSession.CreateBreakpointAsync(new DebugBreakpointLocation(sf.FilePath, 2));
                debugSession.Breakpoints.Count.Should().Be(1);

                await sf.Source(_session);

                var res = (await debugSession.EvaluateAsync("is.function(f)")).As<DebugValueEvaluationResult>();
                res.GetRepresentation(DebugValueRepresentationKind.Normal).Deparse
                    .Should().Be("TRUE");
            }
        }
Exemple #4
0
        //[InlineData(@"'\u2260'", @"""≠""", @"""≠""", "≠")]
        public async Task Representation(string expr, string deparse, string str, string toString) {
            using (var debugSession = new DebugSession(_session)) {
                var res = (await debugSession.EvaluateAsync(expr)).As<DebugValueEvaluationResult>();
                var repr = res.GetRepresentation(DebugValueRepresentationKind.Normal);

                repr.Deparse.Should().Be(deparse);
                repr.Str.Should().Be(str);
                repr.ToString.Should().Be(toString);
            }
        }