Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Test/Mono.Cecil.Tests/ILProcessorTests.cs')
-rw-r--r--Test/Mono.Cecil.Tests/ILProcessorTests.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/Test/Mono.Cecil.Tests/ILProcessorTests.cs b/Test/Mono.Cecil.Tests/ILProcessorTests.cs
index 446e8fc..8836615 100644
--- a/Test/Mono.Cecil.Tests/ILProcessorTests.cs
+++ b/Test/Mono.Cecil.Tests/ILProcessorTests.cs
@@ -194,6 +194,20 @@ namespace Mono.Cecil.Tests {
methodBody.Method.Module.Dispose ();
}
+ [Test]
+ public void EditWithDebugInfoButNoLocalScopes()
+ {
+ var methodBody = CreateTestMethod (OpCodes.Ret);
+ methodBody.Method.DebugInformation = new MethodDebugInformation (methodBody.Method);
+
+ var il = methodBody.GetILProcessor ();
+ il.Replace (methodBody.Instructions [0], il.Create (OpCodes.Nop));
+
+ Assert.AreEqual (1, methodBody.Instructions.Count);
+ Assert.AreEqual (Code.Nop, methodBody.Instructions [0].OpCode.Code);
+ Assert.Null (methodBody.Method.DebugInformation.Scope);
+ }
+
static void AssertOpCodeSequence (OpCode [] expected, MethodBody body)
{
var opcodes = body.Instructions.Select (i => i.OpCode).ToArray ();