From e461940d40dfaf825e469cae871a3a23b277ac37 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 20 Jun 2026 08:50:14 +0200 Subject: [PATCH] Move the LocationsInAst sample beside its test, add a license header Assisted-by: Claude:claude-opus-4-8:Claude Code --- .../ICSharpCode.Decompiler.Tests.csproj | 2 +- .../LocationsInAstSamples.cs | 18 ++++++++++++++++++ .../Output/LocationsInAstTests.cs | 5 +++-- 3 files changed, 22 insertions(+), 3 deletions(-) rename ICSharpCode.Decompiler.Tests/{TestCases/LocationsInAst => Output}/LocationsInAstSamples.cs (50%) diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj index 67b894952..5a4ad0161 100644 --- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj +++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj @@ -101,7 +101,7 @@ - + diff --git a/ICSharpCode.Decompiler.Tests/TestCases/LocationsInAst/LocationsInAstSamples.cs b/ICSharpCode.Decompiler.Tests/Output/LocationsInAstSamples.cs similarity index 50% rename from ICSharpCode.Decompiler.Tests/TestCases/LocationsInAst/LocationsInAstSamples.cs rename to ICSharpCode.Decompiler.Tests/Output/LocationsInAstSamples.cs index 4013465ed..2b67fc8ae 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/LocationsInAst/LocationsInAstSamples.cs +++ b/ICSharpCode.Decompiler.Tests/Output/LocationsInAstSamples.cs @@ -1,3 +1,21 @@ +// Copyright (c) 2026 Siegfried Pammer +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + using System; namespace ICSharpCode.Decompiler.Tests.TestCases.LocationsInAst diff --git a/ICSharpCode.Decompiler.Tests/Output/LocationsInAstTests.cs b/ICSharpCode.Decompiler.Tests/Output/LocationsInAstTests.cs index bd1c241ae..50eeee937 100644 --- a/ICSharpCode.Decompiler.Tests/Output/LocationsInAstTests.cs +++ b/ICSharpCode.Decompiler.Tests/Output/LocationsInAstTests.cs @@ -45,7 +45,8 @@ namespace ICSharpCode.Decompiler.Tests.Output [TestFixture] public class LocationsInAstTests { - static readonly string TestCasePath = Tester.TestCasePath + "/LocationsInAst"; + // The sample source sits next to this test file under Output/, not in TestCases/. + static readonly string SamplesPath = Path.Combine(Tester.TestCasePath, "..", "Output"); const CompilerOptions SampleCompilerOptions = CompilerOptions.UseRoslyn4_14_0 | CompilerOptions.UseDebug | CompilerOptions.Library; @@ -58,7 +59,7 @@ namespace ICSharpCode.Decompiler.Tests.Output [OneTimeSetUp] public void CompileSamples() { - var csFile = Path.Combine(TestCasePath, "LocationsInAstSamples.cs"); + var csFile = Path.Combine(SamplesPath, "LocationsInAstSamples.cs"); compiledSamples = Tester.CompileCSharp(csFile, SampleCompilerOptions).GetAwaiter().GetResult(); }