ElektroKill
3 years ago
No known key found for this signature in database
GPG Key ID: 7E3C5C084E40E3EC
4 changed files with
39 additions and
0 deletions
-
ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
-
ICSharpCode.Decompiler.Tests/TestCases/VBPretty/VBNonGenericForEach.cs
-
ICSharpCode.Decompiler.Tests/TestCases/VBPretty/VBNonGenericForEach.vb
-
ICSharpCode.Decompiler.Tests/VBPrettyTestRunner.cs
|
|
@ -114,6 +114,8 @@ |
|
|
|
<Compile Include="TestAssemblyResolver.cs" /> |
|
|
|
<None Include="TestCases\VBPretty\VBAutomaticEvents.vb" /> |
|
|
|
<Compile Include="TestCases\VBPretty\VBAutomaticEvents.cs" /> |
|
|
|
<Compile Include="TestCases\VBPretty\VBNonGenericForEach.cs" /> |
|
|
|
<None Include="TestCases\VBPretty\VBNonGenericForEach.vb" /> |
|
|
|
<Compile Include="TypeSystem\ReflectionHelperTests.cs" /> |
|
|
|
<None Include="TestCases\Pretty\MetadataAttributes.cs" /> |
|
|
|
<None Include="TestCases\Correctness\ComInterop.cs" /> |
|
|
|
|
|
@ -0,0 +1,20 @@ |
|
|
|
using System; |
|
|
|
using System.Collections; |
|
|
|
using System.Runtime.CompilerServices; |
|
|
|
|
|
|
|
public class VBNonGenericForEach |
|
|
|
{ |
|
|
|
public static void M() |
|
|
|
{ |
|
|
|
ArrayList arrayList = new ArrayList(); |
|
|
|
foreach (object item in arrayList) |
|
|
|
{ |
|
|
|
#if ROSLYN && OPT
|
|
|
|
Console.WriteLine(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(item))); |
|
|
|
#else
|
|
|
|
object objectValue = RuntimeHelpers.GetObjectValue(item); |
|
|
|
Console.WriteLine(RuntimeHelpers.GetObjectValue(objectValue)); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -0,0 +1,11 @@ |
|
|
|
Imports System |
|
|
|
Imports System.Collections |
|
|
|
|
|
|
|
Public Class VBNonGenericForEach |
|
|
|
Public Shared Sub M() |
|
|
|
Dim collection = New ArrayList |
|
|
|
For Each element In collection |
|
|
|
Console.WriteLine(element) |
|
|
|
Next |
|
|
|
End Sub |
|
|
|
End Class |
|
|
@ -131,6 +131,12 @@ namespace ICSharpCode.Decompiler.Tests |
|
|
|
await Run(options: options | CompilerOptions.Library); |
|
|
|
} |
|
|
|
|
|
|
|
[Test] |
|
|
|
public async Task VBNonGenericForEach([ValueSource(nameof(defaultOptions))] CompilerOptions options) |
|
|
|
{ |
|
|
|
await Run(options: options | CompilerOptions.Library); |
|
|
|
} |
|
|
|
|
|
|
|
async Task Run([CallerMemberName] string testName = null, CompilerOptions options = CompilerOptions.UseDebug, DecompilerSettings settings = null) |
|
|
|
{ |
|
|
|
var vbFile = Path.Combine(TestCasePath, testName + ".vb"); |
|
|
|