diff --git a/eng/Versions.props b/eng/Versions.props
index 7a97948c4fd..619d8d4e621 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -196,8 +196,8 @@
1.0.0-beta2-dev3
2.18.48
2.10.69
- 2.4.1
- 2.4.2
+ 2.9.0
+ 2.8.2
5.10.3
2.2.0
diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/Repro1548.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/Repro1548.fs
index 8a8e9dad7d1..eaaf32e7bfe 100644
--- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/Repro1548.fs
+++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/Repro1548.fs
@@ -4,8 +4,6 @@ namespace ErrorMessages
open Xunit
open FSharp.Test.Compiler
-open FSharp.Test.Utilities
-open NUnit.Framework
open FSharp.Compiler.Diagnostics
open FSharp.Test
diff --git a/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs b/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs
index 8e6168f9e76..b477354785b 100644
--- a/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs
+++ b/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs
@@ -444,7 +444,7 @@ let z = Project1.x
ReferencedProjects = [| FSharpReferencedProject.FSharpReference(MultiProjectDirty1.dllName, MultiProjectDirty1.getOptions()) |] }
[]
-[]
+// []
[]
let ``Test multi project symbols should pick up changes in dependent projects`` useTransparentCompiler =
diff --git a/tests/FSharp.Test.Utilities/ProjectGeneration.fs b/tests/FSharp.Test.Utilities/ProjectGeneration.fs
index 8bc60269cee..4c130202e65 100644
--- a/tests/FSharp.Test.Utilities/ProjectGeneration.fs
+++ b/tests/FSharp.Test.Utilities/ProjectGeneration.fs
@@ -742,7 +742,7 @@ module ProjectOperations =
expectOk result ()
Assert.NotEqual(oldSignature, newSignature)
- let expectSignatureContains expected result (_oldSignature, newSignature) =
+ let expectSignatureContains (expected: string) result (_oldSignature, newSignature) =
expectOk result ()
Assert.Contains(expected, newSignature)
diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs
index 2a4b46958d2..f44eb86fe50 100644
--- a/tests/FSharp.Test.Utilities/TestFramework.fs
+++ b/tests/FSharp.Test.Utilities/TestFramework.fs
@@ -7,7 +7,7 @@ open System.IO
open System.Reflection
open System.Diagnostics
open Scripting
-open NUnit.Framework
+open Xunit
open FSharp.Compiler.IO
let inline getTestsDirectory src dir = src ++ dir
@@ -463,21 +463,6 @@ let initializeSuite () =
let suiteHelpers = lazy (initializeSuite ())
-[]
-type public InitializeSuiteAttribute () =
- inherit TestActionAttribute()
-
- override x.BeforeTest details =
- try
- if details.IsSuite
- then suiteHelpers.Force() |> ignore
- with
- | e -> raise (Exception("failed test suite initialization, debug code in InitializeSuiteAttribute", e))
- override x.AfterTest _details =
- ()
-
- override x.Targets = ActionTargets.Test ||| ActionTargets.Suite
-
let testConfig (testDir: string) =
let cfg = suiteHelpers.Value
if not (Path.IsPathRooted testDir) then
diff --git a/tests/FSharp.Test.Utilities/Utilities.fs b/tests/FSharp.Test.Utilities/Utilities.fs
index c862645b0be..199f047dfd1 100644
--- a/tests/FSharp.Test.Utilities/Utilities.fs
+++ b/tests/FSharp.Test.Utilities/Utilities.fs
@@ -13,7 +13,7 @@ open System.Threading.Tasks
open Microsoft.CodeAnalysis
open Microsoft.CodeAnalysis.CSharp
open TestFramework
-open NUnit.Framework
+open Xunit
open System.Collections.Generic
open FSharp.Compiler.CodeAnalysis
open Newtonsoft.Json
@@ -21,19 +21,19 @@ open Newtonsoft.Json.Linq
type TheoryForNETCOREAPPAttribute() =
- inherit Xunit.TheoryAttribute()
+ inherit TheoryAttribute()
#if !NETCOREAPP
do base.Skip <- "Only NETCOREAPP is supported runtime for this kind of test."
#endif
type FactForNETCOREAPPAttribute() =
- inherit Xunit.FactAttribute()
+ inherit FactAttribute()
#if !NETCOREAPP
do base.Skip <- "Only NETCOREAPP is supported runtime for this kind of test."
#endif
type FactForDESKTOPAttribute() =
- inherit Xunit.FactAttribute()
+ inherit FactAttribute()
#if NETCOREAPP
do base.Skip <- "NETCOREAPP is not supported runtime for this kind of test, it is intended for DESKTOP only"
#endif
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/BooleanLogic.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/BooleanLogic.fs
index 55b02adf099..7d7ebba13fb 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/BooleanLogic.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/BooleanLogic.fs
@@ -3,12 +3,11 @@
namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL
open FSharp.Test
-open NUnit.Framework
+open Xunit
-[]
module BooleanLogic =
- []
+ []
let BooleanOrs() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions ([|"-g"; "--optimize+"|],
"""
@@ -54,7 +53,7 @@ let compute (x: int) =
"""
]))
-[]
+
// We had a regression in debug code regression where we were falsely marking pipelines
// as non-side-effecting, causing them to be eliminated in loops.
//
@@ -63,7 +62,7 @@ let compute (x: int) =
// 2. we don't eliminate loops anyway
module DontEliminateForLoopsInDebugCode =
- []
+ []
// See https://github.com/dotnet/fsharp/pull/12021
let Regression12021() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"-g"; "--optimize-"|],
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/ByrefTailcalls.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/ByrefTailcalls.fs
index fff363d406b..a3911244365 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/ByrefTailcalls.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/ByrefTailcalls.fs
@@ -3,15 +3,14 @@
namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL
open FSharp.Test
-open NUnit.Framework
+open Xunit
open System
open System.Threading.Tasks
-[]
module ByrefTailcalls =
- []
+ []
let ``check no tailcall to inref``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions([| "/optimize";"/tailcalls" |],
"""
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/CeEdiThrow.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/CeEdiThrow.fs
index cf9f65fecbb..2bdee531d90 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/CeEdiThrow.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/CeEdiThrow.fs
@@ -2,13 +2,12 @@
namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL
open FSharp.Compiler.UnitTests
-open NUnit.Framework
+open Xunit
open FSharp.Test
-[]
module CeEdiThrow =
- []
+ []
let ``Emits EDI.Throw``() =
CompilerAssert.CompileLibraryAndVerifyIL(
"""
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/ComputationExpressionOptimizations.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/ComputationExpressionOptimizations.fs
index 87c583338f6..ff2ebbcf55d 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/ComputationExpressionOptimizations.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/ComputationExpressionOptimizations.fs
@@ -3,15 +3,15 @@
namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL
open FSharp.Test
-open NUnit.Framework
+open Xunit
open System
#if !DEBUG // sensitive to debug-level code coming across from debug FSharp.Core
-[]
+
module ComputationExpressionOptimizations =
- []
+ []
// See https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1034-lambda-optimizations.md
//
// This tests a number of code optimizations cooperating together.
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/ComputedListExpressions.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/ComputedListExpressions.fs
index 010a2404b1d..d32c0c9d630 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/ComputedListExpressions.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/ComputedListExpressions.fs
@@ -3,12 +3,12 @@
namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL
open FSharp.Test
-open NUnit.Framework
+open Xunit
+
-[]
module ``ComputedListExpressions`` =
- []
+ []
let ``ComputedListExpression01``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"-g"; "--optimize-"|],
"""
@@ -35,7 +35,7 @@ let ListExpressionSteppingTest1 () = [ yield 1 ]
"""
]))
- []
+ []
let ``ComputedListExpression02``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"-g"; "--optimize-"|],
"""
@@ -78,7 +78,7 @@ let ListExpressionSteppingTest2 () =
"""
]))
- []
+ []
let ``ComputedListExpression03``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[|"-g"; "--optimize-"|],
@@ -128,7 +128,7 @@ let ListExpressionSteppingTest3 () =
"""
]))
- []
+ []
let ``ComputedListExpression04``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"-g"; "--optimize-"|],
"""
@@ -212,7 +212,7 @@ let ListExpressionSteppingTest4 () =
"""
]))
- []
+ []
let ``ComputedListExpression05``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"-g"; "--optimize-"|],
"""
@@ -275,7 +275,7 @@ let ListExpressionSteppingTest5 () =
}
"""]))
- []
+ []
let ``ComputedListExpression06``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"-g"; "--optimize-"|],
"""
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/DebugScopes.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/DebugScopes.fs
index b6bb427b336..4374e8491c9 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/DebugScopes.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/DebugScopes.fs
@@ -3,12 +3,12 @@
namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL
open FSharp.Test
-open NUnit.Framework
+open Xunit
+
-[]
module DebugScopes =
- []
+ []
let SimpleFunction() =
CompilerAssert.CompileLibraryAndVerifyDebugInfoWithOptions(
[|"--debug:portable"; "--optimize-"; "--optimize-"|],
@@ -20,7 +20,7 @@ let f x =
2
""")
- []
+ []
let SimpleShadowingFunction() =
CompilerAssert.CompileLibraryAndVerifyDebugInfoWithOptions(
[|"--debug:portable"; "--optimize-"; "--optimize-"|],
@@ -34,7 +34,7 @@ let f x =
2
""")
- []
+ []
let ComplexShadowingFunction() =
CompilerAssert.CompileLibraryAndVerifyDebugInfoWithOptions(
[|"--debug:portable"; "--optimize-"; "--optimize-"|],
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/DelegateAndFuncOptimizations.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/DelegateAndFuncOptimizations.fs
index 7eeadfca205..2b96a319740 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/DelegateAndFuncOptimizations.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/DelegateAndFuncOptimizations.fs
@@ -3,13 +3,13 @@
namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL
open FSharp.Test
-open NUnit.Framework
+open Xunit
#if !DEBUG // sensitive to debug-level code coming across from debug FSharp.Core
-[]
+
module DelegateAndFuncOptimizations =
- []
+ []
// See https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1034-lambda-optimizations.md
let ``Reduce function via InlineIfLambda``() =
CompilerAssert.CompileLibraryAndVerifyIL(
@@ -153,7 +153,7 @@ type C =
"""
]))
- []
+ []
// See https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1034-lambda-optimizations.md
let ``Reduce delegate invoke via InlineIfLambda``() =
CompilerAssert.CompileLibraryAndVerifyIL(
@@ -301,7 +301,7 @@ type C =
"""
]))
- []
+ []
// See https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1034-lambda-optimizations.md
let ``Reduce computed function invoke``() =
CompilerAssert.CompileLibraryAndVerifyIL(
@@ -341,7 +341,7 @@ let ApplyComputedFunction(c: int) =
"""
]))
- []
+ []
// See https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1034-lambda-optimizations.md
let ``Reduce Computed Delegate``() =
CompilerAssert.CompileLibraryAndVerifyIL(
@@ -381,7 +381,7 @@ let ApplyComputedDelegate(c: int) =
"""
]))
- []
+ []
// See https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1034-lambda-optimizations.md
let ``Reduce Computed Function with irreducible match``() =
CompilerAssert.CompileLibraryAndVerifyIL(
@@ -433,7 +433,7 @@ let ApplyComputedFunction(c: int) =
"""
]))
- []
+ []
// See https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1034-lambda-optimizations.md
let ``Immediately apply computed function in sequential``() =
CompilerAssert.CompileLibraryAndVerifyIL(
@@ -492,7 +492,7 @@ let ApplyComputedFunction(c: int) =
"""
]))
- []
+ []
// See https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1034-lambda-optimizations.md
// See also https://github.com/dotnet/fsharp/issues/17607 for a regression caused by realsig+ becoming default
// This test case must keep using direct call to ReduceComputedDelegate, and not a FSharpFunc invocation.
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs
index 5ffee28da00..057004ff01f 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs
@@ -5,10 +5,10 @@ namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL
open System.IO
open FSharp.Test
open FSharp.Test.Compiler
-open NUnit.Framework
+open Xunit
+
-[]
module DeterministicTests =
let commonOptions = ["--refonly";"--deterministic";"--nooptimizationdata"]
@@ -61,7 +61,7 @@ let test() =
mvid1 , mvid2
- []
+ []
let ``Simple assembly should be deterministic``() =
File.WriteAllText(inputPath, basicCodeSnippet)
@@ -71,55 +71,55 @@ let test() =
|> compileGuid
// Two identical compilations should produce the same MVID
- Assert.AreEqual(getMvid(), getMvid())
+ Assert.Equal(getMvid(), getMvid())
- []
+ []
let ``Simple assembly with different platform should not be deterministic``() =
let mvid1 = getMvid basicCodeSnippet ["--deterministic"]
let mvid2 = getMvid basicCodeSnippet ["--deterministic";"--platform:Itanium"]
// No two platforms should produce the same MVID
- Assert.AreNotEqual(mvid1, mvid2)
+ Assert.NotEqual(mvid1, mvid2)
- []
+ []
let ``Simple reference assembly should be deterministic``() =
let mvid1, mvid2 = calculateRefAssMvids basicCodeSnippet basicCodeSnippet
- Assert.AreEqual(mvid1, mvid2)
+ Assert.Equal(mvid1, mvid2)
- []
+ []
let ``Simple reference assembly with different platform should not be deterministic``() =
let mvid1 = getMvid basicCodeSnippet ["--refonly";"--deterministic"]
let mvid2 = getMvid basicCodeSnippet ["--refonly";"--deterministic";"--platform:Itanium"]
// No two platforms should produce the same MVID
- Assert.AreNotEqual(mvid1, mvid2)
+ Assert.NotEqual(mvid1, mvid2)
- []
+ []
let ``False-positive reference assemblies test, different assemblies' mvid should not match`` () =
let src2 = basicCodeSnippet.Replace("test()","test2()")
let mvid1, mvid2 = calculateRefAssMvids basicCodeSnippet src2
- Assert.AreNotEqual(mvid1, mvid2)
+ Assert.NotEqual(mvid1, mvid2)
- []
+ []
let ``Reference assemblies should be deterministic when only private function name is different with the same function name length`` () =
let privCode1 = basicCodeSnippet.Replace("privTest()","privTest1()")
let privCode2 = basicCodeSnippet.Replace("privTest()","privTest2()")
let mvid1, mvid2 = calculateRefAssMvids privCode1 privCode2
- Assert.AreEqual(mvid1, mvid2)
+ Assert.Equal(mvid1, mvid2)
- []
+ []
let ``Reference assemblies should be deterministic when only private function name is different with the different function name length`` () =
let src2 = basicCodeSnippet.Replace("privTest()","privTest11()")
let mvid1, mvid2 = calculateRefAssMvids basicCodeSnippet src2
- Assert.AreEqual(mvid1, mvid2)
+ Assert.Equal(mvid1, mvid2)
- []
+ []
let ``Reference assemblies should be deterministic when only private function body is different`` () =
let src2 = basicCodeSnippet.Replace("""Console.WriteLine("Private Hello World!")""","""Console.Write("Private Hello World!")""")
let mvid1, mvid2 = calculateRefAssMvids basicCodeSnippet src2
- Assert.AreEqual(mvid1, mvid2)
+ Assert.Equal(mvid1, mvid2)
- []
+ []
let ``Reference assemblies should be deterministic when only private function return type is different`` () =
let src2 =
@@ -135,9 +135,9 @@ let test() =
Console.WriteLine()
"""
let mvid1, mvid2 = calculateRefAssMvids basicCodeSnippet src2
- Assert.AreEqual(mvid1, mvid2)
+ Assert.Equal(mvid1, mvid2)
- []
+ []
let ``Reference assemblies should be deterministic when only private function parameter count is different`` () =
let src =
"""
@@ -166,9 +166,9 @@ let test() =
"""
let mvid1, mvid2 = calculateRefAssMvids src src2
- Assert.AreEqual(mvid1, mvid2)
+ Assert.Equal(mvid1, mvid2)
- []
+ []
let ``Reference assemblies should be deterministic when only private function parameter count is different and private function is unused`` () =
let src =
"""
@@ -194,9 +194,9 @@ let test() =
"""
let mvid1, mvid2 = calculateRefAssMvids src src2
- Assert.AreEqual(mvid1, mvid2)
+ Assert.Equal(mvid1, mvid2)
- []
+ []
let ``Reference assemblies should be deterministic when only private function parameter types are different`` () =
let src =
"""
@@ -225,9 +225,9 @@ let test() =
"""
let mvid1, mvid2 = calculateRefAssMvids src src2
- Assert.AreEqual(mvid1, mvid2)
+ Assert.Equal(mvid1, mvid2)
- []
+ []
let ``Reference assemblies should be deterministic when private function is missing in one of them`` () =
let src =
"""
@@ -253,9 +253,9 @@ let test() =
"""
let mvid1, mvid2 = calculateRefAssMvids src src2
- Assert.AreEqual(mvid1, mvid2)
+ Assert.Equal(mvid1, mvid2)
- []
+ []
let ``Reference assemblies should be deterministic when inner function is removed`` () =
let src =
"""
@@ -282,9 +282,9 @@ let test() =
"""
let mvid1, mvid2 = calculateRefAssMvids src src2
- Assert.AreEqual(mvid1, mvid2)
+ Assert.Equal(mvid1, mvid2)
- []
+ []
let ``Reference assemblies should be same when contents of quoted expression change`` () =
let src =
"""
@@ -301,26 +301,26 @@ let foo () = <@ 2 + 3 @>
"""
let mvid1, mvid2 = calculateRefAssMvids src src2
- Assert.AreEqual(mvid1, mvid2)
+ Assert.Equal(mvid1, mvid2)
- []
+ []
let ``Reference assemblies must change when a must-inline function changes body`` () =
let codeBefore = """module ReferenceAssembly
let inline myFunc x y = x + y"""
let codeAfter = codeBefore.Replace("+","-")
let mvid1, mvid2 = calculateRefAssMvids codeBefore codeAfter
- Assert.AreNotEqual(mvid1,mvid2)
+ Assert.NotEqual(mvid1,mvid2)
- []
+ []
let ``Reference assemblies must not change when a must-inline function does not change`` () =
let codeBefore = """module ReferenceAssembly
let inline myFunc x y = x - y"""
let mvid1, mvid2 = calculateRefAssMvids codeBefore codeBefore
- Assert.AreEqual(mvid1,mvid2)
-
+ Assert.Equal(mvid1,mvid2)
- [] // If IVT provided -> MVID must reflect internal binding
- [] // No IVT => internal binding can be ignored for mvid purposes
+ []
+ [] // If IVT provided -> MVID must reflect internal binding
+ [] // No IVT => internal binding can be ignored for mvid purposes
let ``Reference assemblies MVID when having internal binding``(additionalSnippet:string, shouldBeStable:bool) =
let codeAfter =
basicCodeSnippet
@@ -330,6 +330,6 @@ let inline myFunc x y = x - y"""
let mvid1, mvid2 = calculateRefAssMvids basicCodeSnippet codeAfter
if shouldBeStable then
- Assert.AreEqual(mvid1,mvid2)
+ Assert.Equal(mvid1,mvid2)
else
- Assert.AreNotEqual(mvid1,mvid2)
+ Assert.NotEqual(mvid1,mvid2)
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs
index b4a6fcedc41..4030c65d302 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs
@@ -4,13 +4,13 @@ namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL
open FSharp.Compiler.UnitTests
open FSharp.Test
-open NUnit.Framework
+open Xunit
+
-[]
module ``Mutation`` =
// Regression test for FSHARP1.0:1206
- []
+ []
let ``Mutation 01``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[|"-g"; "--optimize-";"--realsig+"|],
@@ -45,7 +45,7 @@ type Test = struct
"""
]))
- []
+ []
let ``Mutation 02``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[|"-g"; "--optimize-";"--realsig+"|],
@@ -91,7 +91,7 @@ x.ToString()
"""
]))
- []
+ []
let ``Mutation 03``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[|"-g"; "--optimize-";"--realsig+"|],
@@ -136,7 +136,7 @@ x.Day
"""
]))
- []
+ []
let ``Mutation 04``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[|"-g"; "--optimize-";"--realsig+"|],
@@ -182,7 +182,7 @@ x.ToString()
"""
]))
- []
+ []
let ``Mutation 05``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[|"-g"; "--optimize-";"--realsig+"|],
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs
index e3fd6a0d2f8..e3803ce8437 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs
@@ -3,16 +3,16 @@
namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL
open FSharp.Test.Compiler
-open NUnit.Framework
+open Xunit
open FSharp.Compiler.IO
-[]
+
module ReferenceAssemblyTests =
let referenceAssemblyAttributeExpectedIL =
""".custom instance void [runtime]System.Runtime.CompilerServices.ReferenceAssemblyAttribute::.ctor() = ( 01 00 00 00 )"""
- []
+ []
let ``Simple reference assembly should have expected IL``() =
let src =
"""
@@ -46,7 +46,7 @@ let test() =
]
|> ignore
- []
+ []
let ``Simple reference assembly should have expected IL without a private function``() =
let src =
"""
@@ -84,7 +84,7 @@ let test() =
]
|> ignore
- []
+ []
let ``Simple reference assembly should have expected IL with anonymous record``() =
let src =
"""
@@ -111,7 +111,7 @@ let test(_x: {| a: int32 |}) =
]
|> ignore
- []
+ []
let ``Simple reference assembly with nested module should have expected IL``() =
let src =
"""
@@ -153,7 +153,7 @@ module Nested =
]
|> ignore
- []
+ []
let ``Simple reference assembly with nested module with type should have expected IL``() =
let src =
"""
@@ -496,7 +496,7 @@ module Nested =
#endif
] |> ignore
- []
+ []
let ``--refout should produce both normal and reference assemblies``() =
// TODO: We probably want a built-in test framework functionality which will be taking care of comparing/verifying refout.
let refoutDllPath = FileSystem.GetTempPathShim() + "Test.ref.dll"
@@ -558,7 +558,7 @@ let test() =
}"""
]
- []
+ []
let ``Internal DU type doesn't generate any properties/methods without IVT`` () =
FSharp """
module ReferenceAssembly
@@ -591,7 +591,7 @@ extends [runtime]System.Object
} """]
- []
+ []
let ``Types with internal-only properties and methods don't generate anything without IVT`` () =
FSharp """
module ReferenceAssembly
@@ -628,7 +628,7 @@ extends [runtime]System.Object
}"""]
- []
+ []
let ``Cli events are emitted even for CliEvent members which are not last in a file`` () =
FSharp """
module LibraryWithTwoClassesAndTwoEvents
@@ -726,7 +726,7 @@ type MyClass2() =
.removeon instance void LibraryWithTwoClassesAndTwoEvents/MyClass2::remove_EventFromSecondType(class [runtime]System.EventHandler`1)
""" ]
- []
+ []
let ``Properties are emitted for CliMutable records`` () =
FSharp """
namespace ReferenceAssembly
@@ -738,7 +738,7 @@ type [] MyRecord = { MyId: int }"""
referenceAssemblyAttributeExpectedIL
" .property instance int32 MyId()"]
- []
+ []
let ``Properties are emitted even for CliMutable records which are not last in a file`` () =
FSharp """
namespace ReferenceAssembly
@@ -753,7 +753,7 @@ type [] MySecondRecord = { MySecondId: strin
" .property instance int32 MyId()"
" .property instance string MySecondId()"]
- [] // Regression https://github.com/dotnet/fsharp/issues/14088 .
+ [] // Regression https://github.com/dotnet/fsharp/issues/14088 .
// Generated IL was assigning properties to the last record in file instead of where they are supposed to be
let ``Properties are emitted for equal records in the same file`` () =
FSharp """
@@ -904,7 +904,7 @@ type [] MySecondRecord = { Name: string }
]
- []
+ []
let ``Properties, getters, setters are emitted for internal properties`` () =
FSharp """
module ReferenceAssembly
@@ -1013,7 +1013,7 @@ type MySecondaryAttribute() =
} """
]
- []
+ []
let ``Internal and private fields are emitted for structs`` () =
FSharp """
module ReferenceAssembly
@@ -1042,7 +1042,7 @@ type AStruct =
.custom instance void [FSharp.Core]Microsoft.FSharp.Core.DefaultValueAttribute::.ctor() = ( 01 00 00 00 )
}"""
]
- []
+ []
let ``Only public properties are emitted on non-IVT assemblies`` () =
FSharp """
module ReferenceAssembly
@@ -1117,7 +1117,7 @@ type MType() =
}
} """
]
- []
+ []
let ``Only public events are emitted for non-IVT assembly`` () =
FSharp """
module ReferenceAssembly
@@ -1149,7 +1149,7 @@ type MType() =
} """
]
- []
+ []
let ``Internal constructor is emitted for attribute`` () =
FSharp """
module ReferenceAssembly
@@ -1278,7 +1278,7 @@ type Person(name : string, age : int) =
}"""
]
- []
+ []
let ``Internal constructor is emitted for attribute (with fsi)`` () =
let fsSig =
Fsi """
@@ -1377,7 +1377,7 @@ extends [runtime]System.Object
} """ ]
- []
+ []
let ``Build .exe with --refonly ensure it produces a main in the ref assembly`` () =
FSharp """module ReferenceAssembly
open System
@@ -1407,7 +1407,7 @@ Console.WriteLine("Hello World!")"""
]
|> ignore
#if NETCOREAPP
- []
+ []
#endif
let ``Refassembly_emits_static_abstracts_implementations_the_same_way_it_does_for_instance_with_empty_signature`` () =
@@ -1473,7 +1473,7 @@ type CompilerGoesBoom<'a>() =
#if NETCOREAPP
- []
+ []
#endif
let ``Refassembly_emits_static_abstracts_implementations_the_same_way_it_does_for_instance_with_signature`` () =
let signature = """namespace Foobar
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticLinkTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticLinkTests.fs
index b18f47eae1d..a76c80a6dd9 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticLinkTests.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticLinkTests.fs
@@ -6,12 +6,12 @@ open System.IO
open System.Reflection
open FSharp.Test
open FSharp.Test.Utilities
-open NUnit.Framework
+open Xunit
+
-[]
module StaticLinkTests =
- []
+ []
let ``Static link simple library``() =
let module1 =
let source =
@@ -35,7 +35,7 @@ printfn "%A" y
deps
|> List.iter (fun dep -> try File.Delete dep with | _ -> ())))
- []
+ []
let ``Simple exe should fail to execute if dependency was not found and is not statically linked``() =
let module1 =
let source =
@@ -60,7 +60,7 @@ printfn "%A" y
deps
|> List.iter (fun dep -> try File.Delete dep with | _ -> ())))) |> ignore
- []
+ []
let ``Simple exe should execute if dependency was found and is not statically linked``() =
let module1 =
let source =
@@ -81,7 +81,7 @@ printfn "%A" y
CompilerAssert.Execute module2
- []
+ []
let ``Static link quotes in multiple modules``() =
let module1 =
let source =
@@ -154,7 +154,7 @@ else failwith "Test Failed"
CompilerAssert.Execute(module2, ignoreWarnings=true)
- []
+ []
let ``Static link quotes in multiple modules - optimized``() =
let module1 =
let source =
@@ -227,7 +227,7 @@ else failwith "Test Failed"
CompilerAssert.Execute(module2, ignoreWarnings=true)
- []
+ []
let ``Standalone linking``() =
let source =
"""
@@ -240,7 +240,7 @@ let _ = exit 0
let module1 = Compilation.Create(source, Exe, [|"--standalone"|])
CompilerAssert.Execute(module1, newProcess=true)
- []
+ []
let ``Standalone linking - optimized``() =
let source =
"""
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs
index 340c1963fd3..464b7ca7d13 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs
@@ -3,12 +3,12 @@
namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL
open FSharp.Test
-open NUnit.Framework
+open Xunit
+
-[]
module ``Static Member`` =
- []
+ []
let ``Action on Static Member``() =
CompilerAssert.CompileLibraryAndVerifyILRealSig(
"""
@@ -72,7 +72,7 @@ type C =
"""
]))
- []
+ []
let ``Action on Static Member with lambda``() =
CompilerAssert.CompileLibraryAndVerifyILRealSig(
"""
@@ -131,7 +131,7 @@ type C =
"""
]))
- []
+ []
let ``Action on Static Member with closure``() =
CompilerAssert.CompileLibraryAndVerifyILRealSig(
"""
@@ -245,7 +245,7 @@ let main _ =
"""
]))
- []
+ []
let ``Func on Static Member``() =
CompilerAssert.CompileLibraryAndVerifyILRealSig(
"""
@@ -311,7 +311,7 @@ type C =
"""
]))
- []
+ []
let ``Func on Static Member with lambda``() =
CompilerAssert.CompileLibraryAndVerifyILRealSig(
"""
@@ -377,7 +377,7 @@ type C =
"""
]))
- []
+ []
let ``Func on Static Member with closure``() =
CompilerAssert.CompileLibraryAndVerifyILRealSig(
"""
@@ -432,7 +432,7 @@ let main _ =
]))
#if !FX_NO_WINFORMS
- []
+ []
let ``EventHandler from Regression/83``() =
CompilerAssert.CompileLibraryAndVerifyILRealSig(
"""
diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs
index 4345540ad44..7fe5a0db4b4 100644
--- a/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs
+++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs
@@ -3,7 +3,7 @@
namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL
open FSharp.Test
-open NUnit.Framework
+open Xunit
open System
open System.Threading.Tasks
@@ -12,7 +12,7 @@ open System.Threading.Tasks
// The code generated changes slightly in debug mode
#if !DEBUG
// Check the exact code produced for tasks
-[]
+
module TaskGeneratedCode =
// This tests the exact optimized code generated for the MoveNext for a trivial task - we expect 'MoveNext' to be there
@@ -26,7 +26,7 @@ module TaskGeneratedCode =
// IL_000e: ldc.i4.1
// IL_000f: stfld int32 Test/testTask@4::Result
- []
+ []
let ``check MoveNext of simple task debug``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[| "/optimize-"; "/debug:portable";"--realsig+"; "/tailcalls-" |],
@@ -113,7 +113,7 @@ let testTask() = task { return 1 }
// IL_000e: ldc.i4.1
// IL_000f: stfld int32 Test/testTask@4::Result
- []
+ []
let ``check MoveNext of simple task optimized``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[| "/optimize+"; "/debug:portable";"--realsig+"; "/tailcalls+" |],
@@ -187,7 +187,7 @@ let testTask() = task { return 1 }
]))
- []
+ []
let ``check MoveNext of simple binding task debug``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[| "/debug:portable";"--realsig+"; "/optimize-"; "/tailcalls-" |],
@@ -367,7 +367,7 @@ let testTask(t: Task) = task { let! res = t in return res+1 }
module TaskTryFinallyGeneration =
- []
+ []
let ``check MoveNext of task try/finally optimized``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[| "/optimize+"; "/debug:portable";"--realsig+"; "/tailcalls+" |],
@@ -476,7 +476,7 @@ let testTask() = task { try 1+1 finally System.Console.WriteLine("finally") }
]))
- []
+ []
let ``check MoveNext of task try/finally debug``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[| "/optimize-"; "/debug:portable";"--realsig+"; "/tailcalls-" |],
@@ -593,7 +593,7 @@ let testTask() = task { try 1+1 finally System.Console.WriteLine("finally") }
module TaskTryWithGeneration =
- []
+ []
let ``check MoveNext of task try/with optimized``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[| "/optimize+"; "/debug:portable";"--realsig+"; "/tailcalls+" |],
@@ -706,7 +706,7 @@ let testTask() = task { try 1 with e -> System.Console.WriteLine("finally"); 2 }
]))
- []
+ []
let ``check MoveNext of task try/with debug``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[| "/optimize-"; "/debug:portable";"--realsig+"; "/tailcalls-" |],
@@ -826,7 +826,7 @@ let testTask() = task { try 1 with e -> System.Console.WriteLine("with"); 2 }
module TaskWhileLoopGeneration =
- []
+ []
let ``check MoveNext of task while loop optimized``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[| "/optimize+"; "/debug:portable";"--realsig+"; "/tailcalls+" |],
@@ -924,7 +924,7 @@ let testTask() = task { while x > 4 do System.Console.WriteLine("loop") }
]))
- []
+ []
let ``check MoveNext of task while loop debug``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[| "/optimize-"; "/debug:portable";"--realsig+"; "/tailcalls-" |],
@@ -1027,7 +1027,7 @@ let testTask() = task { while x > 4 do System.Console.WriteLine("loop") }
module TaskTypeInference =
// This tests the compilation of a case that hits corner cases in SRTP constraint processing.
// See https://github.com/dotnet/fsharp/issues/12188
- []
+ []
let ``check initially ambiguous SRTP task code ``() =
CompilerAssert.CompileExeAndRunWithOptions(
[| "/optimize-"; "/debug:portable";"--realsig+"; "/tailcalls-" |],
@@ -1047,7 +1047,7 @@ let myTuple : (string -> Task) * int = (fun (_s: string) -> Task.FromResul
""")
// Test task code in generic position
- []
+ []
let ``check generic task code ``() =
CompilerAssert.CompileExeAndRunWithOptions(
[| "/optimize-"; "/debug:portable";"--realsig+"; "/tailcalls-" |],
@@ -1080,7 +1080,7 @@ printfn "test passed"
#if !DEBUG
- []
+ []
let ``check generic task exact code``() =
CompilerAssert.CompileLibraryAndVerifyILWithOptions(
[| "/optimize-"; "/debug:portable";"--realsig+"; "/tailcalls-" |],
@@ -1382,9 +1382,9 @@ type Generic1InGeneric1<'T>() =
#if NETCOREAPP
-[]
+
module ``Check stack traces`` =
- []
+ []
let ``check stack trace of async exception from task``() =
let t() =
task {
@@ -1412,7 +1412,7 @@ module ``Check stack traces`` =
// Test that the SRTP Bind on a ValueTask is still generic in the bind type
-[]
+
module ``Check return attributes`` =
let incr (x:int) : [] (int -> int) = (fun a -> a + x)
@@ -1420,7 +1420,7 @@ module ``Check return attributes`` =
// If the function is curried its inferred arity should be no more than
// the declared arguments (the F# rule that infers additional arguments
// should not kick in).
- []
+ []
let ``check return attribute of curried function``() =
match <@ incr 3 4 @> with
| Quotations.Patterns.Application (Quotations.Patterns.Call(None, mi, [Quotations.DerivedPatterns.Int32 3]), Quotations.DerivedPatterns.Int32 4) ->
diff --git a/tests/fsharp/Compiler/Conformance/BasicGrammarElements/BasicConstants.fs b/tests/fsharp/Compiler/Conformance/BasicGrammarElements/BasicConstants.fs
index de3fe8e0c24..5606ff7bc79 100644
--- a/tests/fsharp/Compiler/Conformance/BasicGrammarElements/BasicConstants.fs
+++ b/tests/fsharp/Compiler/Conformance/BasicGrammarElements/BasicConstants.fs
@@ -2,14 +2,12 @@
namespace FSharp.Compiler.UnitTests
-open NUnit.Framework
+open Xunit
open FSharp.Test
-open FSharp.Compiler.Diagnostics
-[]
module ``Basic Grammar Element Constants`` =
- []
+ []
let ``Basic constants compile `` () =
CompilerAssert.Pass
"""
@@ -53,7 +51,7 @@ let boolConst2 = false
let unitConst = ()
"""
- []
+ []
let ``Long with underscores``() =
CompilerAssert.CompileExeAndRun
"""
@@ -66,7 +64,7 @@ printfn "%A" socialSecurityNumber
printfn "%A" creditCardNumber
"""
- []
+ []
let ``float 32 with underscores``() =
CompilerAssert.CompileExeAndRun
"""
@@ -75,7 +73,7 @@ if pi <> 3.1415F then failwith "Wrong parsing"
printfn "%A" pi
"""
- []
+ []
let ``int with underscores hexBytes``() =
CompilerAssert.CompileExeAndRun
"""
@@ -85,7 +83,7 @@ printfn "%A" hexBytes
"""
- []
+ []
let ``int with underscore hexWords``() =
CompilerAssert.CompileExeAndRun
"""
@@ -94,7 +92,7 @@ if hexWords <> 0xCAFEBABE then failwith "Wrong parsing"
printfn "%A" hexWords
"""
- []
+ []
let ``Long with underscores maxLong``() =
CompilerAssert.CompileExeAndRun
"""
@@ -103,7 +101,7 @@ if maxLong <> 0x7fffffffffffffffL then failwith "Wrong parsing"
printfn "%A" maxLong
"""
- []
+ []
let ``int with underscore nybbles``() =
CompilerAssert.CompileExeAndRun
"""
@@ -112,7 +110,7 @@ if nybbles <> 0b00100101 then failwith "Wrong parsing"
printfn "%A" nybbles
"""
- []
+ []
let ``int with underscores bytes``() =
CompilerAssert.CompileExeAndRun
"""
@@ -121,7 +119,7 @@ if bytes <> 0b11010010011010011001010010010010 then failwith "Wrong parsing"
printfn "%A" bytes
"""
- []
+ []
let ``int with single underscore literal``() =
CompilerAssert.CompileExeAndRun
"""
@@ -130,7 +128,7 @@ if x2 <> 52 then failwith "Wrong parsing"
printfn "%A" x2
"""
- []
+ []
let ``int with multiple underscores literal``() =
CompilerAssert.CompileExeAndRun
"""
@@ -139,7 +137,7 @@ if x4 <> 52 then failwith "Wrong parsing"
printfn "%A" x4
"""
- []
+ []
let ``int with single underscore Hex literal``() =
CompilerAssert.CompileExeAndRun
"""
@@ -149,7 +147,7 @@ if x7 <> 0x52 then
printfn "%A" x7
"""
- []
+ []
let ``int with single underscore after leading zero literal``() =
CompilerAssert.CompileExeAndRun
"""
@@ -158,7 +156,7 @@ if x9 <> 052 then failwith "Wrong parsing"
printfn "%A" x9
"""
- []
+ []
let ``int with single underscore after literal with leading zero ``() =
CompilerAssert.CompileExeAndRun
"""
@@ -167,7 +165,7 @@ if x10 <> 052 then failwith "Wrong parsing"
printfn "%A" x10
"""
- []
+ []
let ``int with single underscore after octo literal ``() =
CompilerAssert.CompileExeAndRun
"""
@@ -175,7 +173,7 @@ let x14 = 0o5_2
if x14 <> 0o52 then failwith "Wrong parsing"
printfn "%A" x14
"""
- []
+ []
let ``dotless float``() =
CompilerAssert.CompileExeWithOptions([|"--langversion:5.0"|],
"""
@@ -183,35 +181,35 @@ let x = 42f
printfn "%A" x
""")
- []
+ []
let ``dotted float``() =
CompilerAssert.CompileExe("""
let x = 42.f
printfn "%A" x
""")
- []
+ []
let ``dotted floats should be equal to dotless floats``() =
CompilerAssert.CompileExeAndRunWithOptions([|"--langversion:5.0"|],
"""
if 1.0f <> 1f then failwith "1.0f <> 1f"
""")
- []
+ [