From e33dbd7eca4969805a2499f27e011691b178422c Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 23 Jun 2026 10:12:37 +0200 Subject: [PATCH] Use SDK default Compile items in ICSharpCode.Decompiler.Tests The project listed 201 explicit and 119 items with EnableDefaultItems=false. Many test-case sources had been marked only because the C# compiler available when they were written could not build them; the current Roslyn compiles them fine. The hand-maintained lists had also drifted: five committed fixtures (Operators.cs, Issue3751.cs, three ILPretty .cs) were on disk with passing tests but in no item list. Switch to the SDK default **/*.cs glob and exclude only the sources that still cannot be compiled into the test assembly, determined empirically by building with everything included and removing what failed: - IL-pretty inputs that are not valid standalone C# and *.Expected.cs golden outputs that reuse type names (compile errors / duplicate definitions). - MetadataAttributes.cs, which applies assembly/module attributes that break NUnit test discovery (zero tests found) when compiled into the assembly. The excluded sources stay for IDE visibility; the harness compiles them from disk at test time regardless. This compiles 23 more fixtures than before while keeping every previously-compiled file. Default None globbing stays off so the non-C# inputs (.il/.vb/.fs) remain the authoritative list. Operators.cs, now part of the build, is normalized to the repo's tab indentation by the format hook (a CS110 block used spaces). Verified: the full suite still reports 2257 passed, 0 failed, 35 skipped. Assisted-by: Claude:claude-opus-4-8:Claude Code --- .../ICSharpCode.Decompiler.Tests.csproj | 324 ++++-------------- .../TestCases/Pretty/Operators.cs | 10 +- 2 files changed, 78 insertions(+), 256 deletions(-) diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj index 7cf6c5221..94b10baa7 100644 --- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj +++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj @@ -29,7 +29,10 @@ False False False - false + + false True @@ -101,8 +104,6 @@ - - @@ -114,9 +115,7 @@ - - @@ -130,7 +129,6 @@ - @@ -144,268 +142,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -427,4 +180,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Operators.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Operators.cs index d6a521bf3..96a033415 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Operators.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Operators.cs @@ -95,10 +95,10 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty } #if CS110 - public static AllOperators operator >>>(AllOperators a, int b) - { - return null; - } + public static AllOperators operator >>>(AllOperators a, int b) + { + return null; + } #endif public static AllOperators operator ~(AllOperators a) @@ -236,7 +236,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty c = a << 5; c = a >> 5; #if CS110 - c = a >>> 5; + c = a >>> 5; #endif c = ~a; c = !a;