Browse Source

Move the LocationsInAst sample beside its test, add a license header

Assisted-by: Claude:claude-opus-4-8:Claude Code
pull/3807/head
Siegfried Pammer 3 weeks ago committed by Siegfried Pammer
parent
commit
e461940d40
  1. 2
      ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
  2. 18
      ICSharpCode.Decompiler.Tests/Output/LocationsInAstSamples.cs
  3. 5
      ICSharpCode.Decompiler.Tests/Output/LocationsInAstTests.cs

2
ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj

@ -101,7 +101,7 @@ @@ -101,7 +101,7 @@
<None Include="TestCases\IsolatedDecompilation\IsolatedStaticCtor.il" />
<None Include="TestCases\ILPretty\ExtensionEncodingV2.il" />
<None Include="testcases\ilpretty\ExtensionEncodingV1.il" />
<None Include="TestCases\LocationsInAst\LocationsInAstSamples.cs" />
<None Include="Output\LocationsInAstSamples.cs" />
<None Include="TestCases\ILPretty\GuessAccessors.cs" />
<None Include="TestCases\ILPretty\GuessAccessors.il" />
<None Include="TestCases\ILPretty\Issue2260SwitchString.il" />

18
ICSharpCode.Decompiler.Tests/TestCases/LocationsInAst/LocationsInAstSamples.cs → ICSharpCode.Decompiler.Tests/Output/LocationsInAstSamples.cs

@ -1,3 +1,21 @@ @@ -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

5
ICSharpCode.Decompiler.Tests/Output/LocationsInAstTests.cs

@ -45,7 +45,8 @@ namespace ICSharpCode.Decompiler.Tests.Output @@ -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 @@ -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();
}

Loading…
Cancel
Save