From 6ac9b813e64ad398a9ba5ba948796d4f387e1add Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sun, 30 Aug 2026 13:13:15 +0200 Subject: [PATCH] Fix nondeterministic VBPretty test failure. --- .../TestCases/VBPretty/VBAnonymousTypes.cs | 5 ----- ICSharpCode.Decompiler.Tests/VBPrettyTestRunner.cs | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/VBAnonymousTypes.cs b/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/VBAnonymousTypes.cs index dde61d8b2..6ae40a6f3 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/VBAnonymousTypes.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/VBAnonymousTypes.cs @@ -12,13 +12,8 @@ using Microsoft.VisualBasic.CompilerServices; // A VB anonymous type. Its properties are settable and only those declared 'Key' // take part in Equals and GetHashCode, so it cannot be written as a C# anonymous // type and is declared here instead. -#if LEGACY_VBC && OPT [DebuggerDisplay("Value={Value}, Name={Name}")] [CompilerGenerated] -#else -[CompilerGenerated] -[DebuggerDisplay("Value={Value}, Name={Name}")] -#endif internal sealed class VB_AnonymousType_0 { #if !OPT && !LEGACY_VBC diff --git a/ICSharpCode.Decompiler.Tests/VBPrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/VBPrettyTestRunner.cs index 3cd9f3b09..a700d4e7c 100644 --- a/ICSharpCode.Decompiler.Tests/VBPrettyTestRunner.cs +++ b/ICSharpCode.Decompiler.Tests/VBPrettyTestRunner.cs @@ -193,7 +193,8 @@ namespace ICSharpCode.Decompiler.Tests } var executable = await Tester.CompileVB(vbFile, options | CompilerOptions.ReferenceVisualBasic, exeFile).ConfigureAwait(false); - var decompiled = await Tester.DecompileCSharp(executable.PathToAssembly, settings ?? new DecompilerSettings { FileScopedNamespaces = false }).ConfigureAwait(false); + settings ??= new DecompilerSettings { FileScopedNamespaces = false, SortCustomAttributes = true }; + var decompiled = await Tester.DecompileCSharp(executable.PathToAssembly, settings).ConfigureAwait(false); CodeAssert.FilesAreEqual(csFile, decompiled, Tester.GetPreprocessorSymbols(options).ToArray()); Tester.RepeatOnIOError(() => File.Delete(decompiled));