Skip to content

Commit

Permalink
Add failing test for #694 (#695)
Browse files Browse the repository at this point in the history
Co-authored-by: Jb Evain <[email protected]>
  • Loading branch information
ltrzesniewski and jbevain authored Oct 13, 2020
1 parent 90e23f1 commit a1105a4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Test/Mono.Cecil.Tests/PortablePdbTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -748,5 +748,28 @@ public void DoubleWriteAndReadAgainModuleWithDeterministicMvid ()
Assert.AreNotEqual (mvid1_in, mvid2_in);
Assert.AreNotEqual (mvid1_out, mvid2_out);
}

[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 a1105a4

Please sign in to comment.