Skip to content

Commit 1672d20

Browse files
committed
[WIP] Migrate Compiler.UnitTests to xUnit
1 parent d9014b2 commit 1672d20

12 files changed

Lines changed: 425 additions & 411 deletions

FSharpBuild.Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<!-- directory locations -->
1111
<PropertyGroup>
1212
<FSharpSourcesRoot>$(RepoRoot)src</FSharpSourcesRoot>
13+
<FSharpTestsRoot>$(RepoRoot)tests</FSharpTestsRoot>
1314
<SymStoreDirectory>$(ArtifactsDir)\SymStore</SymStoreDirectory>
1415
<ProtoOutputPath>$(ArtifactsDir)\Bootstrap</ProtoOutputPath>
1516
<ValueTupleImplicitPackageVersion>4.4.0</ValueTupleImplicitPackageVersion>

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,6 @@
187187
<StrawberryPerlVersion>5.28.0.1</StrawberryPerlVersion>
188188
<StreamJsonRpcVersion>2.0.187</StreamJsonRpcVersion>
189189
<XUnitVersion>2.4.1</XUnitVersion>
190-
<FluentAssertionsVersion>2.4.1</FluentAssertionsVersion>
190+
<FluentAssertionsVersion>5.10.3</FluentAssertionsVersion>
191191
</PropertyGroup>
192192
</Project>

tests/Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<PackageReference Include="NunitXml.TestLogger" Version="$(NunitXmlTestLoggerVersion)" />
1010
</ItemGroup>
1111
<ItemGroup Condition="'$(UnitTestType)' == 'xunit'">
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" />
12+
<!-- <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" /> -->
1313
<PackageReference Include="xunit" Version="$(XUnitVersion)" />
1414
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitVersion)" />
1515
<PackageReference Include="NunitXml.TestLogger" Version="$(NunitXmlTestLoggerVersion)" />

tests/FSharp.Compiler.UnitTests/EditDistance.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ module EditDistance =
2222
[<InlineData("RICK", "RICK", 0)>]
2323
[<InlineData("MARTHA", "MARHTA", 1)>]
2424
[<InlineData("'T", "'u", 1)>]
25-
let EditDistanceTest (str1 : string, str2 : string, expected : string) : unit =
25+
let EditDistanceTest (str1 : string, str2 : string, expected : int) : unit =
2626
CalcEditDistance(str1,str2)
2727
|> Assert.shouldBe expected

tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<OutputType>Library</OutputType>
99
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
1010
<UnitTestType>xunit</UnitTestType>
11+
<NoWarn>$(NoWarn);3186;1104;NETSDK1023</NoWarn>
1112
</PropertyGroup>
1213

1314
<ItemGroup>
@@ -24,6 +25,7 @@
2425
<ItemGroup>
2526
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj" />
2627
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj" />
28+
<ProjectReference Include="$(FSharpTestsRoot)\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj" />
2729
</ItemGroup>
2830

2931
</Project>

0 commit comments

Comments
 (0)