Skip to content

Commit

Permalink
Add failing test for jbevain#694
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrzesniewski committed Oct 2, 2020
1 parent e9a4815 commit fe8b5a0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Test/Mono.Cecil.Tests/PortablePdbTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -770,5 +770,27 @@ public void LoadPdbOnDemand ()
Assert.AreEqual (9, debug_info.SequencePoints.Count);
}

[Test]
public void ClearSequencePoints ()
{
TestPortablePdbModule (module => {
var type = module.GetType ("PdbTarget.Program");
var main = type.GetMethod ("Main");

main.DebugInformation.SequencePoints.Clear ();

var destination = Path.Combine (Path.GetTempPath (), "mylib.dll");
module.Write(destination, new WriterParameters { WriteSymbols = true });

Assert.Zero (main.DebugInformation.SequencePoints.Count);

using (var resultModule = ModuleDefinition.ReadModule (destination, new ReaderParameters { ReadSymbols = true })) {
type = resultModule.GetType ("PdbTarget.Program");
main = type.GetMethod ("Main");

Assert.Zero (main.DebugInformation.SequencePoints.Count);
}
});
}
}
}

0 comments on commit fe8b5a0

Please sign in to comment.