Skip to content

Add properties for arrays, strings and other System classes #66823

Description

@ilonatommy

Array, string and e.g. Type have properties that are not supported in the debugger:

  • int_arr.Length;
  • str[0];
  • some_type.FullName;

Beyond typical tests add null-condition checking tests, something of this kind:

[ConditionalFact(nameof(RunningOnChrome))]
public async Task EvaluateNullPrimitivePropertiesPositive() => await CheckInspectLocalsAtBreakpointSite(
     $"DebuggerTests.EvaluateNullableProperties", "Evaluate", 11, "Evaluate",
     $"window.setTimeout(function() {{ invoke_static_method ('[debugger-test] DebuggerTests.EvaluateNullableProperties:Evaluate'); 1 }})",
     wait_for_event_fn: async (pause_location) =>
     {
            var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
            await EvaluateOnCallFrameAndCheck(id,
                   ("str.Length", TNumber(9))
                   ("str?.Length", TNumber(9)),
                   ("str!.Length", TNumber(9)),
                   ("str_null?.Length", TObject("string", is_null: true)),
                   ("str_null!.Length", TObject("string", is_null: true))
            );
    });

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions