diff options
author | Jb Evain <jb@evain.net> | 2021-03-13 04:36:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-13 04:36:32 +0300 |
commit | 553506adb74b1edbc12a8fb8cd681dcc93f180cf (patch) | |
tree | 1c8c0c1ebfed8a981d781875c25d87c8f32b8678 /Test/Mono.Cecil.Tests | |
parent | 3c4ea3f8f4fcb688194f5f1e501ab01642d4bdf4 (diff) |
Fix reading GenericInst constants in portable pdbs (#729)
* Fix reading GenericInst constants in portable pdbs
* Add test
Diffstat (limited to 'Test/Mono.Cecil.Tests')
-rw-r--r-- | Test/Mono.Cecil.Tests/PortablePdbTests.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Test/Mono.Cecil.Tests/PortablePdbTests.cs b/Test/Mono.Cecil.Tests/PortablePdbTests.cs index fc0516e..b0c1f32 100644 --- a/Test/Mono.Cecil.Tests/PortablePdbTests.cs +++ b/Test/Mono.Cecil.Tests/PortablePdbTests.cs @@ -457,6 +457,24 @@ namespace Mono.Cecil.Tests { } [Test] + public void GenericInstConstantRecord () + { + using (var module = GetResourceModule ("ReproConstGenericInst.dll", new ReaderParameters { SymbolReaderProvider = new PortablePdbReaderProvider () })) { + var type = module.GetType ("ReproConstGenericInst.Program"); + var method = type.GetMethod ("Main"); + var symbol = method.DebugInformation; + + Assert.IsNotNull (symbol); + Assert.AreEqual (1, symbol.Scope.Constants.Count); + + var list = symbol.Scope.Constants [0]; + Assert.AreEqual ("list", list.Name); + + Assert.AreEqual ("System.Collections.Generic.List`1<System.String>", list.ConstantType.FullName); + } + } + + [Test] public void SourceLink () { TestModule ("TargetLib.dll", module => { |