diff options
author | Zoltan Varga <vargaz@gmail.com> | 2020-01-11 12:04:00 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2020-01-11 12:04:00 +0300 |
commit | 46ab3f4fb7251f4e3b3bd355766f4f364774df8b (patch) | |
tree | 9e9ded41bef50aced51b3b3a4e7e6ce8b421427e /test/Mono.Linker.Tests | |
parent | 8a82325ce8f34ed02655b834f4c6821b9d8f7011 (diff) |
Add support for fields substitutions. (#908)
* Add support for fields substitutions.
* Update StubBodyWithValue.cs
* Update RemoveUnreachableBlocksStep.cs
* Tests and checks tweaks
* Add optional way to initialize stubbed fields
* Update BodySubstituterStep.cs
Co-authored-by: Marek Safar <marek.safar@gmail.com>
Diffstat (limited to 'test/Mono.Linker.Tests')
-rw-r--r-- | test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs b/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs index 11fae84e6..16f4a1d1d 100644 --- a/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs +++ b/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs @@ -98,6 +98,14 @@ namespace Mono.Linker.Tests.TestCasesRunner { } VerifyTypeDefinitionKept (original, linked); + + if (original.HasAttribute (nameof (CreatedMemberAttribute))) { + foreach (var attr in original.CustomAttributes.Where (l => l.AttributeType.Name == nameof (CreatedMemberAttribute))) { + var newName = original.FullName + "::" + attr.ConstructorArguments [0].Value.ToString (); + + Assert.AreEqual (1, linkedMembers.RemoveWhere (l => l.Contains (newName)), $"Newly created member '{newName}' was not found"); + } + } } protected virtual void VerifyTypeDefinitionKept (TypeDefinition original, TypeDefinition linked) |