Skip to content

Commit

Permalink
Creating test to close dotnet#49141
Browse files Browse the repository at this point in the history
  • Loading branch information
thaystg committed Jul 19, 2021
1 parent 32a3d66 commit e16d422
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -862,5 +862,19 @@ public async Task BreakpointOnHiddenLineOfMethodWithNoNextVisibleLineShouldNotPa
Task t = await Task.WhenAny(pause_task, Task.Delay(2000));
Assert.True(t != pause_task, "Debugger unexpectedly paused");
}

[Fact]
public async Task StepAndEvaluateProperty()
{
await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 663, 0);

string expression = "window.setTimeout(function() { invoke_static_method ('[debugger-test] Foo:RunBar'); }, 1);";
await EvaluateAndCheck(
expression,
"dotnet://debugger-test.dll/debugger-test.cs", 663, 12,
"Bar");
await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 666, 8, "Bar");
await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 667, 4, "Bar");
}
}
}
20 changes: 20 additions & 0 deletions src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,23 @@ internal static void ApplyUpdate (System.Reflection.Assembly assm, int version)
}
}


public class Foo
{
public string Lorem { get; set; } = "Safe";
public int Bar()
{
int ret;
if (Lorem.StartsWith('S'))
ret = 0;
else
ret = 1;
return ret;
}
public static void RunBar()
{
Foo foo = new Foo();
foo.Bar();
}
}

0 comments on commit e16d422

Please sign in to comment.