From e052ab52e44fd2a6564964e47e79929068731916 Mon Sep 17 00:00:00 2001 From: Steve Gilham Date: Thu, 29 Sep 2022 22:59:52 +0100 Subject: Address issue #873 (#874) * Address issue #873 * Be explicit as to what we support writing * Use normal test infrastructure * Restore writing primitives * Restore style * Can't verify .net core assembly Co-authored-by: Jb Evain --- Test/Mono.Cecil.Tests/PortablePdbTests.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Test/Mono.Cecil.Tests') diff --git a/Test/Mono.Cecil.Tests/PortablePdbTests.cs b/Test/Mono.Cecil.Tests/PortablePdbTests.cs index 3aa0ffc..a89f79d 100644 --- a/Test/Mono.Cecil.Tests/PortablePdbTests.cs +++ b/Test/Mono.Cecil.Tests/PortablePdbTests.cs @@ -453,6 +453,23 @@ namespace Mono.Cecil.Tests { }, symbolReaderProvider: typeof (PortablePdbReaderProvider), symbolWriterProvider: typeof (PortablePdbWriterProvider)); } + [Test] + public void NullGenericInstConstant () + { + TestModule ("NullConst.dll", module => { + var type = module.GetType ("NullConst.Program"); + var method = type.GetMethod ("MakeConst"); + var symbol = method.DebugInformation; + + Assert.IsNotNull (symbol); + Assert.AreEqual (1, symbol.Scope.Constants.Count); + + var a = symbol.Scope.Constants [0]; + Assert.AreEqual ("thing", a.Name); + Assert.AreEqual (null, a.Value); + }, verify: false, symbolReaderProvider: typeof (PortablePdbReaderProvider), symbolWriterProvider: typeof (PortablePdbWriterProvider)); + } + [Test] public void InvalidConstantRecord () { -- cgit v1.2.3