From 0be27161262aed5a21210307198b73df239a548b Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 24 May 2024 16:41:59 -0700 Subject: [PATCH] Fix unit tests --- tests/OmniSharp.Cake.Tests/BlockStructureFacts.cs | 4 +++- tests/OmniSharp.MSBuild.Tests/AbstractMSBuildTestFixture.cs | 1 + tests/OmniSharp.Roslyn.CSharp.Tests/BlockStructureFacts.cs | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/OmniSharp.Cake.Tests/BlockStructureFacts.cs b/tests/OmniSharp.Cake.Tests/BlockStructureFacts.cs index a170950055..9dfd9d1ab3 100644 --- a/tests/OmniSharp.Cake.Tests/BlockStructureFacts.cs +++ b/tests/OmniSharp.Cake.Tests/BlockStructureFacts.cs @@ -38,7 +38,9 @@ void M()[| .ToArray(); var expected = testFile.Content.GetSpans() - .Select(span => testFile.Content.GetRangeFromSpan(span).ToRange()).ToArray(); + .Select(span => testFile.Content.GetRangeFromSpan(span).ToRange()) + .Reverse() + .ToArray(); Assert.Equal(expected, lineSpans); } diff --git a/tests/OmniSharp.MSBuild.Tests/AbstractMSBuildTestFixture.cs b/tests/OmniSharp.MSBuild.Tests/AbstractMSBuildTestFixture.cs index 37c1cdc6d2..fcccd4d201 100644 --- a/tests/OmniSharp.MSBuild.Tests/AbstractMSBuildTestFixture.cs +++ b/tests/OmniSharp.MSBuild.Tests/AbstractMSBuildTestFixture.cs @@ -28,6 +28,7 @@ public AbstractMSBuildTestFixture(ITestOutputHelper output) // prerelease version so that our .NET 7 tests will pass. var configuration = new Dictionary { + ["sdk:Version"] = "8.0.201", ["sdk:IncludePrereleases"] = bool.TrueString }.ToConfiguration(); diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/BlockStructureFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/BlockStructureFacts.cs index 2579e0baba..e4e165adeb 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/BlockStructureFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/BlockStructureFacts.cs @@ -37,7 +37,9 @@ void M()[| .ToArray(); var expected = testFile.Content.GetSpans() - .Select(span => testFile.Content.GetRangeFromSpan(span).ToRange()).ToArray(); + .Select(span => testFile.Content.GetRangeFromSpan(span).ToRange()) + .Reverse() + .ToArray(); Assert.Equal(expected, lineSpans); }