From 079276b4bc4c187663337564ac0529f3fbdc6a8b Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 8 Jun 2020 17:30:04 +0200 Subject: [PATCH 01/15] Added readme file with testing proposal --- tests/README.md | 112 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 tests/README.md diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 00000000000..29a80031a1d --- /dev/null +++ b/tests/README.md @@ -0,0 +1,112 @@ +# F# Testing proposal + +## Why do we test + +* To prevent regressions (behavioral, performance). +* To have a quicker debug feedback (thus, find problems quicker). +* To verify conformance to language spec (API contract testing). +* To have IL verification (both read and write). +* To have a quicker design feedback. +* To document behavior. + +## Goals + +* Use one standardized testing framework across all of test projects, and get rid of custom old solutions (FSharpQA and Cambridge suites). +* Have tests restructured the way, that they are easy to discover. +* Have tests building and running on all supported platforms (Windows, macOS and Linux) and different frameworks (with exceptions when this is not applicable). +* Make it easy to run tests using standard .NET instruments (dotnet cli, test explorer, etc.). +* Leverage standard .NET testing platform and use all its benefits, suck as live unit testing, code coverage collecting, dead code elimination, etc. + +## Framework for testing + +The following test frameworks and libraries will be used for new test projects **[xUnit Test Framework](https://xunit.net/), [FluentAssertions](https://fluentassertions.com/) (+ [FsUnit](https://fsprojects.github.io/FsUnit/) and [FsCheck](https://github.com/fscheck/FsCheck) when needed)**. All existing NUnit test suites will be migrated to xUnit. + +**Justification:** + +* **xUnit** is an extensible, TDD adherent, testing framework, which was successfully adopted by many .NET engineering teams, including Roslyn, AspNetCore, EFcore, etc, has a "cleaner" approach for writing test suites (i.e. class constructor for setup, implementing IDisposable for teardown, as oppose to custom attributes). More info [here](https://xunit.net/docs/comparisons). +* **FluentAssertions** makes it easier to write scoped assertions, provides better error messages. + +**Alternatives:** NUnit, MSBuild, Expecto + +### Tests categorization + +#### New tests should be grouped based on two factors: test type (1) + test category and subcategory (2) + +1. **Test type**: +**Determines what type of test is it:** + * __Functional tests__: + * __Unit Tests__: a lightweight testing for smaller modules, functions, etc. + * __Examples__: Testing individual parts/functions of lexer, parser, syntax tree, standard library modules, etc. + * __Subgroups__: there should be a separation between testing private and public parts of each module (i.e. compiler tests for private and public API should be in separate test projects). + * __Component Tests__: testing for bigger parts of compiler. + * __Examples__: Tests for the compiler components as whole, such as Code generation, IL Generation, Compiler optimizations, Type Checker, Type Providers, Conformance, etc. + * __Integration and End2End Tests__: testing of F# compiler & tooling integration, as well as e2e experiences. + * __Examples__: VS Integration, .NET Interactive integration, LSP integration. Integration with dotnet CLI, project creation, building, running. + * __Non-functional tests__: + * __Load and Stress Tests__: testing for high level modules/components to understand peak performance and potentially catch any performance regressions. + * __Examples__: measuring compile, build, link times for the compiler, individual functions (i.e. data structures sorting, traversing, etc.). +1. **Test category and subcategory**: Tests (sub)categories shall be determined by the project, library, module, and functionality tests are covering. + +#### Examples + +* F# compiler component test which is verifying generated IL for computation expression will have category `Compiler` and subcategories `EmittedIL` and `ComputationExpressions`. +* F# compiler service unit test which is testing F# tokenizer, will have category `Compiler.Service` and subcategory `Tokenizer`. + +Please, refer to [File and project structure](#File-and-project-structure) for more information on how tests will be organized on the filesystem. + +## File and project structure + +### Naming schema + +The proposed naming schema for test projects is: `FSharp.Category.Subcategory.TestType`, where +`Category.Subcategory` is either a corresponding source project, or a more generic component (e.g. `Compiler`, `Compiler.Private` or more granular `Compiler.CodeGen`, `Compiler.CodeGen.EmittedIL` if category or subcategory project becomes too big, etc.) and `TestType` is the type of the test (one of `UnitTests`, `ComponentTests`, `IntegrationTests`, `LoadTests`). + +### Projects organization + +Please refer to the "[Naming schema](#Naming-schema)" section above for more information on the projects naming. + +New test projects will be grouped by category and test type, all subcategories are just test folders/files in the test project. + +* __Examples__: Having test project organized like: + > `tests/FSharp.Compiler.ComponentTests/CodeGen/EmittedIL/BasicTests.fs` + > `tests/FSharp.Compiler.ComponentTests/CodeGen/StringEncoding/StringTests.fs` + > `tests/FSharp.Compiler.ComponentTests/Optimizations/Inlining/InliningTests.fs` + + Will result in one test dll "`FSharp.Compiler.ComponentTests.dll`" which will contain all the subcategories of tests. +* **Notes**: + * This will result in reduced fragmentation of tests, all the tests files are under one big category, easier to understand what each component/unit test suite covers, less confusion in test classification for new tests. + * If some categories (or subcategories) will become big enough - they can be factored out to a separate project. + +### Test Utilities/Helpers + +For all new and migrated tests, any common/helper functionality shall be factored out to a separate project - `FSharp.Test.Utilities`. + +## New tests + +* All new tests should be created in the new projects only. +* All new tests should contain a brief docstring description of what is being tested, link to an issue if applicable. +* All new tests should be categorized using xUnit's `Trait`, based on their `Category` and `Subcategories`. + +## Migrating existing tests + +Existing FSharpQA and Cambridge need to be migrated to corresponding test projects: component-style tests to the `FSharp.Compiler.ComponentTests` and unittest-style tests - `FSharp.Compiler.UnitTests`, `FSharp.Compiler.Private.Scripting.UnitTests`, `FSharp.Build.UnitTests`, etc. + +## Next steps + +* [**In Progress**] Move `FSharp.TestHelpers` to `FSharp.Test.Utilities`. +* [**In Progress**] Create initial test projects structure for new tests (`FSharp.Compiler.ComponentTests`). +* [**In Progress**] Migrate existing `NUnit` tests to xUnit. +* [**In progress**] Change build scripts to run new suites as well as old ones. +* Start migration of existing (namely, FSharpQA and Cambridge) suites to xUnit-based projects. + +## Open questions: + +* As far as I know, [FSharp.Compiler.Service](https://github.com/fsharp/FSharp.Compiler.Service) is dependant on some of the F# compiler tests. Does it have to be changed as well? + +## Other + +Related issues: (https://github.com/dotnet/fsharp/issues/7075) + +You can find this document under 'tests/README.md'. + +**I would like to hear some feedback the community, so we can quickly re-iterate over it (if needed), and start working :)** \ No newline at end of file From d9014b2553289f3b0810909f3c1f924e72f2e622 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 9 Jun 2020 14:43:33 +0200 Subject: [PATCH 02/15] [WIP] Moving to xUnit --- FSharp.sln | 2 +- VisualFSharp.sln | 2 +- eng/Versions.props | 4 +- tests/Directory.Build.targets | 6 + .../ByteMemoryTests.fs | 9 +- .../FSharp.Compiler.UnitTests/EditDistance.fs | 30 +-- .../FSharp.Compiler.UnitTests.fsproj | 3 +- tests/FSharp.Compiler.UnitTests/FsiTests.fs | 231 +++++++++--------- .../HashIfExpression.fs | 16 +- .../ManglingNameOfProvidedTypes.fs | 47 ++-- .../FSharp.Compiler.UnitTests/NunitHelpers.fs | 2 +- .../ProductVersion.fs | 49 ++-- .../SuggestionBuffer.fs | 29 +-- .../CompilerAssert.fs | 4 +- .../Directory.Build.props | 0 .../FSharp.TestHelpers.fsproj | 3 +- .../ILChecker.fs | 2 +- .../TestFramework.fs | 0 .../Utilities.fs | 4 +- .../CodeGen/EmittedIL/LiteralValue.fs | 2 +- .../Compiler/CodeGen/EmittedIL/Mutation.fs | 2 +- .../CodeGen/EmittedIL/StaticLinkTests.fs | 2 +- .../CodeGen/EmittedIL/StaticMember.fs | 2 +- .../Compiler/CodeGen/EmittedIL/TailCalls.fs | 2 +- .../BasicGrammarElements/BasicConstants.fs | 2 +- .../DataExpressions/ComputationExpressions.fs | 2 +- .../ConstraintSolver/MemberConstraints.fs | 2 +- .../ConstraintSolver/PrimitiveConstraints.fs | 2 +- .../AccessOfTypeAbbreviationTests.fs | 4 +- .../ErrorMessages/AssignmentErrorTests.fs | 4 +- .../Compiler/ErrorMessages/ClassesTests.fs | 2 +- .../ErrorMessages/ConstructorTests.fs | 2 +- .../ErrorMessages/DontSuggestTests.fs | 2 +- .../ElseBranchHasWrongTypeTests.fs | 2 +- .../InvalidNumericLiteralTests.fs | 4 +- .../ErrorMessages/MissingElseBranch.fs | 2 +- .../ErrorMessages/MissingExpressionTests.fs | 4 +- .../ErrorMessages/ModuleAbbreviationTests.fs | 4 +- .../ErrorMessages/NameResolutionTests.fs | 4 +- .../ErrorMessages/SuggestionsTests.fs | 4 +- .../ErrorMessages/TypeMismatchTests.fs | 2 +- .../ErrorMessages/UnitGenericAbstactType.fs | 2 +- .../ErrorMessages/UpcastDowncastTests.fs | 2 +- .../ErrorMessages/WarnExpressionTests.fs | 2 +- .../ErrorMessages/WrongSyntaxInForLoop.fs | 2 +- .../Compiler/Language/AnonRecordTests.fs | 2 +- tests/fsharp/Compiler/Language/ByrefTests.fs | 4 +- .../Language/CompilerDirectiveTests.fs | 2 +- .../Language/CustomCollectionTests.fs | 2 +- .../Language/DefaultInterfaceMemberTests.fs | 4 +- .../Compiler/Language/FixedIndexSliceTests.fs | 2 +- .../Compiler/Language/HatDesugaringTests.fs | 2 +- .../Compiler/Language/OpenStaticClasses.fs | 4 +- .../Compiler/Language/OptionalInteropTests.fs | 4 +- .../Language/SlicingQuotationTests.fs | 2 +- .../Language/SpanOptimizationTests.fs | 2 +- tests/fsharp/Compiler/Language/SpanTests.fs | 2 +- .../Language/StringConcatOptimizationTests.fs | 2 +- .../Compiler/Language/TypeAttributeTests.fs | 2 +- tests/fsharp/Compiler/Language/UIntTests.fs | 4 +- .../Libraries/Core/Collections/ListTests.fs | 4 +- .../ExtraTopLevelOperators/DictionaryTests.fs | 2 +- .../LanguagePrimitives/CastToUnitsTests.fs | 4 +- .../ForInDoMutableRegressionTest.fs | 2 +- .../Regressions/IndexerRegressionTests.fs | 2 +- .../fsharp/Compiler/Stress/LargeExprTests.fs | 4 +- .../Warnings/AssignmentWarningTests.fs | 4 +- .../Warnings/ExperimentalAttributeTests.fs | 2 +- .../Warnings/PatternMatchingWarningTests.fs | 2 +- tests/fsharp/FSharpSuite.Tests.fsproj | 2 +- tests/fsharp/TypeProviderTests.fs | 2 +- tests/fsharp/tests.fs | 4 +- 72 files changed, 299 insertions(+), 284 deletions(-) rename tests/{FSharp.TestHelpers => FSharp.Test.Utilities}/CompilerAssert.fs (99%) rename tests/{FSharp.TestHelpers => FSharp.Test.Utilities}/Directory.Build.props (100%) rename tests/{FSharp.TestHelpers => FSharp.Test.Utilities}/FSharp.TestHelpers.fsproj (93%) rename tests/{FSharp.TestHelpers => FSharp.Test.Utilities}/ILChecker.fs (99%) rename tests/{FSharp.TestHelpers => FSharp.Test.Utilities}/TestFramework.fs (100%) rename tests/{FSharp.TestHelpers => FSharp.Test.Utilities}/Utilities.fs (99%) diff --git a/FSharp.sln b/FSharp.sln index 99d8ae47eb4..5302949640d 100644 --- a/FSharp.sln +++ b/FSharp.sln @@ -24,7 +24,7 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsiAnyCpu", "src\fsharp\fsi {649FA588-F02E-457C-9FCF-87E46407481E} = {649FA588-F02E-457C-9FCF-87E46407481E} EndProjectSection EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.TestsHelpers", "tests\FSharp.TestHelpers\FSharp.TestHelpers.fsproj", "{60D275B0-B14A-41CB-A1B2-E815A7448FCB} " +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.TestsHelpers", "tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj", "{60D275B0-B14A-41CB-A1B2-E815A7448FCB} " EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharpSuite.Tests", "tests\fsharp\FSharpSuite.Tests.fsproj", "{C163E892-5BF7-4B59-AA99-B0E8079C67C4}" EndProject diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 6a71aec0e43..6649fa2074b 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -86,7 +86,7 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsiAnyCpu", "src\fsharp\fsi EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsi", "src\fsharp\fsi\fsi.fsproj", "{D0E98C0D-490B-4C61-9329-0862F6E87645}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.TestsHelpers", "tests\FSharp.TestHelpers\FSharp.TestHelpers.fsproj", "{60D275B0-B14A-41CB-A1B2-E815A7448FCB} " +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.TestsHelpers", "tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj", "{60D275B0-B14A-41CB-A1B2-E815A7448FCB} " EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharpSuite.Tests", "tests\fsharp\FSharpSuite.Tests.fsproj", "{C163E892-5BF7-4B59-AA99-B0E8079C67C4}" EndProject diff --git a/eng/Versions.props b/eng/Versions.props index 9bc5e185e36..a6fcf9439e4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -176,7 +176,7 @@ 2.7.0 3.0.0-preview-27318-01 3.0.0-preview-27318-01 - 15.8.0 + 16.6.1 4.3.0 9.0.1 3.11.0 @@ -186,5 +186,7 @@ 1.0.0-beta2-dev3 5.28.0.1 2.0.187 + 2.4.1 + 2.4.1 diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets index e28338a5d44..77272699622 100644 --- a/tests/Directory.Build.targets +++ b/tests/Directory.Build.targets @@ -8,5 +8,11 @@ + + + + + + diff --git a/tests/FSharp.Compiler.UnitTests/ByteMemoryTests.fs b/tests/FSharp.Compiler.UnitTests/ByteMemoryTests.fs index 09e518d62ea..27c490054f4 100644 --- a/tests/FSharp.Compiler.UnitTests/ByteMemoryTests.fs +++ b/tests/FSharp.Compiler.UnitTests/ByteMemoryTests.fs @@ -3,14 +3,15 @@ namespace FSharp.Compiler.UnitTests open System open System.Globalization -open NUnit.Framework +open Xunit +open FSharp.Test.Utilities + -[] module ByteMemoryTests = open FSharp.Compiler.AbstractIL.Internal - [] + [] let ``ByteMemory.CreateMemoryMappedFile succeeds with byte length of zero``() = let memory = ByteMemory.Empty.AsReadOnly() let newMemory = ByteMemory.CreateMemoryMappedFile memory - Assert.AreEqual(0, newMemory.Length) \ No newline at end of file + Assert.shouldBe(0, newMemory.Length) \ No newline at end of file diff --git a/tests/FSharp.Compiler.UnitTests/EditDistance.fs b/tests/FSharp.Compiler.UnitTests/EditDistance.fs index ffcac4bc775..f6f3ec1f03a 100644 --- a/tests/FSharp.Compiler.UnitTests/EditDistance.fs +++ b/tests/FSharp.Compiler.UnitTests/EditDistance.fs @@ -3,23 +3,25 @@ namespace FSharp.Compiler.UnitTests open System open System.Globalization -open NUnit.Framework +open Xunit +open FSharp.Test.Utilities -[] module EditDistance = open Internal.Utilities.EditDistance - [] - [] - [] - [] - [] - let JaroWinklerTest (str1 : string, str2 : string) : string = + [] + [] + [] + [] + [] + let JaroWinklerTest (str1 : string, str2 : string, expected : string) : unit = String.Format(CultureInfo.InvariantCulture, "{0:0.000}", JaroWinklerDistance str1 str2) + |> Assert.shouldBe expected - [] - [] - [] - [] - let EditDistanceTest (str1 : string, str2 : string) : int = - CalcEditDistance(str1,str2) \ No newline at end of file + [] + [] + [] + [] + let EditDistanceTest (str1 : string, str2 : string, expected : string) : unit = + CalcEditDistance(str1,str2) + |> Assert.shouldBe expected diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj index fd54495d324..b0001c2e11a 100644 --- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj +++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj @@ -7,11 +7,10 @@ netcoreapp3.0 Library true - nunit + xunit - diff --git a/tests/FSharp.Compiler.UnitTests/FsiTests.fs b/tests/FSharp.Compiler.UnitTests/FsiTests.fs index 7be552bb695..23c1e30dd7a 100644 --- a/tests/FSharp.Compiler.UnitTests/FsiTests.fs +++ b/tests/FSharp.Compiler.UnitTests/FsiTests.fs @@ -4,7 +4,8 @@ module FSharp.Compiler.UnitTests.FsiTests open System open System.IO open FSharp.Compiler.Interactive.Shell -open NUnit.Framework +open Xunit +open FSharp.Test.Utilities #nowarn "1104" @@ -21,13 +22,13 @@ let createFsiSession () = let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration() FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, new StreamWriter(outStream), new StreamWriter(errStream), collectible = true) -[] +[] let ``No bound values at the start of FSI session`` () = use fsiSession = createFsiSession () let values = fsiSession.GetBoundValues() Assert.IsEmpty values -[] +[] let ``Bound value has correct name`` () = use fsiSession = createFsiSession () @@ -35,9 +36,9 @@ let ``Bound value has correct name`` () = let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("x", boundValue.Name) + Assert.shouldBe("x", boundValue.Name) -[] +[] let ``Bound value has correct value`` () = use fsiSession = createFsiSession () @@ -45,9 +46,9 @@ let ``Bound value has correct value`` () = let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual(2, boundValue.Value.ReflectionValue) + Assert.shouldBe(2, boundValue.Value.ReflectionValue) -[] +[] let ``Bound value has correct type`` () = use fsiSession = createFsiSession () @@ -55,9 +56,9 @@ let ``Bound value has correct type`` () = let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) -[] +[] let ``Seven bound values are ordered and have their correct name`` () = use fsiSession = createFsiSession () @@ -71,9 +72,9 @@ let ``Seven bound values are ordered and have their correct name`` () = let names = fsiSession.GetBoundValues() |> List.map (fun x -> x.Name) - Assert.AreEqual(["a";"aa";"b";"ccc";"x";"y";"z"], names) + Assert.shouldBe(["a";"aa";"b";"ccc";"x";"y";"z"], names) -[] +[] let ``Seven bound values are ordered and have their correct value`` () = use fsiSession = createFsiSession () @@ -87,9 +88,9 @@ let ``Seven bound values are ordered and have their correct value`` () = let values = fsiSession.GetBoundValues() |> List.map (fun x -> x.Value.ReflectionValue) - Assert.AreEqual([4;7;6;5;1;2;3], values) + Assert.shouldBe([4;7;6;5;1;2;3], values) -[] +[] let ``Seven bound values are ordered and have their correct type`` () = use fsiSession = createFsiSession () @@ -103,9 +104,9 @@ let ``Seven bound values are ordered and have their correct type`` () = let types = fsiSession.GetBoundValues() |> List.map (fun x -> x.Value.ReflectionType) - Assert.AreEqual([typeof;typeof;typeof;typeof;typeof;typeof;typeof], types) + Assert.shouldBe([typeof;typeof;typeof;typeof;typeof;typeof;typeof], types) -[] +[] let ``Able to find a bound value by the identifier`` () = use fsiSession = createFsiSession () @@ -121,7 +122,7 @@ let ``Able to find a bound value by the identifier`` () = Assert.IsTrue boundValueOpt.IsSome -[] +[] let ``Able to find a bound value by the identifier and has valid info`` () = use fsiSession = createFsiSession () @@ -135,11 +136,11 @@ let ``Able to find a bound value by the identifier and has valid info`` () = let boundValue = (fsiSession.TryFindBoundValue "z").Value - Assert.AreEqual("z", boundValue.Name) - Assert.AreEqual(3, boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("z", boundValue.Name) + Assert.shouldBe(3, boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) -[] +[] let ``Not Able to find a bound value by the identifier`` () = use fsiSession = createFsiSession () @@ -155,7 +156,7 @@ let ``Not Able to find a bound value by the identifier`` () = Assert.IsTrue boundValueOpt.IsNone -[] +[] let ``The 'it' value does not exist at the start of a FSI session`` () = use fsiSession = createFsiSession () @@ -163,7 +164,7 @@ let ``The 'it' value does not exist at the start of a FSI session`` () = Assert.IsTrue boundValueOpt.IsNone -[] +[] let ``The 'it' bound value does exists after a value is not explicitly bound`` () = use fsiSession = createFsiSession () @@ -173,7 +174,7 @@ let ``The 'it' bound value does exists after a value is not explicitly bound`` ( Assert.IsTrue boundValueOpt.IsSome -[] +[] let ``The 'it' value does exists after a value is not explicitly bound and has valid info`` () = use fsiSession = createFsiSession () @@ -181,47 +182,47 @@ let ``The 'it' value does exists after a value is not explicitly bound and has v let boundValue = (fsiSession.TryFindBoundValue "it").Value - Assert.AreEqual("it", boundValue.Name) - Assert.AreEqual(456, boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("it", boundValue.Name) + Assert.shouldBe(456, boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) -[] +[] let ``The latest shadowed value is only available`` () = use fsiSession = createFsiSession () fsiSession.EvalInteraction("let x = 1") let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("x", boundValue.Name) - Assert.AreEqual(1, boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("x", boundValue.Name) + Assert.shouldBe(1, boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) fsiSession.EvalInteraction("let x = (1, 2)") let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("x", boundValue.Name) - Assert.AreEqual((1, 2), boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("x", boundValue.Name) + Assert.shouldBe((1, 2), boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) -[] +[] let ``The latest shadowed value is only available and can be found`` () = use fsiSession = createFsiSession () fsiSession.EvalInteraction("let x = 1") let boundValue = (fsiSession.TryFindBoundValue "x").Value - Assert.AreEqual("x", boundValue.Name) - Assert.AreEqual(1, boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("x", boundValue.Name) + Assert.shouldBe(1, boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) fsiSession.EvalInteraction("let x = (1, 2)") let boundValue = (fsiSession.TryFindBoundValue "x").Value - Assert.AreEqual("x", boundValue.Name) - Assert.AreEqual((1, 2), boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("x", boundValue.Name) + Assert.shouldBe((1, 2), boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) -[] +[] let ``Values are successfully shadowed even with intermediate interactions`` () = use fsiSession = createFsiSession () @@ -232,21 +233,21 @@ let ``Values are successfully shadowed even with intermediate interactions`` () let boundValues = fsiSession.GetBoundValues() - Assert.AreEqual(3, boundValues.Length) + Assert.shouldBe(3, boundValues.Length) let boundValue = boundValues |> List.find (fun x -> x.Name = "x") - Assert.AreEqual("x", boundValue.Name) - Assert.AreEqual((1, 2), boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("x", boundValue.Name) + Assert.shouldBe((1, 2), boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) let boundValue = (fsiSession.TryFindBoundValue "x").Value - Assert.AreEqual("x", boundValue.Name) - Assert.AreEqual((1, 2), boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("x", boundValue.Name) + Assert.shouldBe((1, 2), boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) -[] +[] let ``Creation of a simple bound value succeeds`` () = use fsiSession = createFsiSession () @@ -254,11 +255,11 @@ let ``Creation of a simple bound value succeeds`` () = let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("x", boundValue.Name) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) - Assert.AreEqual(1, boundValue.Value.ReflectionValue) + Assert.shouldBe("x", boundValue.Name) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe(1, boundValue.Value.ReflectionValue) -[] +[] let ``Creation of a bound value succeeds with underscores in the identifier`` () = use fsiSession = createFsiSession () @@ -266,9 +267,9 @@ let ``Creation of a bound value succeeds with underscores in the identifier`` () let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("x_y_z", boundValue.Name) + Assert.shouldBe("x_y_z", boundValue.Name) -[] +[] let ``Creation of a bound value succeeds with tildes in the identifier`` () = use fsiSession = createFsiSession () @@ -276,9 +277,9 @@ let ``Creation of a bound value succeeds with tildes in the identifier`` () = let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("``hello world``", boundValue.Name) + Assert.shouldBe("``hello world``", boundValue.Name) -[] +[] let ``Creation of a bound value succeeds with 'it' as the indentifier`` () = use fsiSession = createFsiSession () @@ -286,77 +287,77 @@ let ``Creation of a bound value succeeds with 'it' as the indentifier`` () = let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("it", boundValue.Name) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("it", boundValue.Name) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) fsiSession.AddBoundValue("it", 1) let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("it", boundValue.Name) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("it", boundValue.Name) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) -[] +[] let ``Creation of a bound value fails with tildes in the identifier and with 'at' but has warning`` () = use fsiSession = createFsiSession () Assert.Throws(fun () -> fsiSession.AddBoundValue("``hello @ world``", 1)) |> ignore -[] +[] let ``Creation of a bound value fails if the name is not a valid identifier with 'at' in front`` () = use fsiSession = createFsiSession () Assert.Throws(fun () -> fsiSession.AddBoundValue("@x", 1)) |> ignore -[] +[] let ``Creation of a bound value fails if the name is not a valid identifier with 'at' in back`` () = use fsiSession = createFsiSession () Assert.Throws(fun () -> fsiSession.AddBoundValue("x@", 1)) |> ignore -[] +[] let ``Creation of a bound value fails if the name is null`` () = use fsiSession = createFsiSession () Assert.Throws(fun () -> fsiSession.AddBoundValue(null, 1)) |> ignore -[] +[] let ``Creation of a bound value fails if the name is empty`` () = use fsiSession = createFsiSession () Assert.Throws(fun () -> fsiSession.AddBoundValue("", 1)) |> ignore -[] +[] let ``Creation of a bound value fails if the name is whitespace`` () = use fsiSession = createFsiSession () Assert.Throws(fun () -> fsiSession.AddBoundValue(" ", 1)) |> ignore -[] +[] let ``Creation of a bound value fails if the name contains spaces`` () = use fsiSession = createFsiSession () Assert.Throws(fun () -> fsiSession.AddBoundValue("x x", 1)) |> ignore -[] +[] let ``Creation of a bound value fails if the name contains an operator at the end`` () = use fsiSession = createFsiSession () Assert.Throws(fun () -> fsiSession.AddBoundValue("x+", 1)) |> ignore -[] +[] let ``Creation of a bound value fails if the name contains an operator at the front`` () = use fsiSession = createFsiSession () Assert.Throws(fun () -> fsiSession.AddBoundValue("+x", 1)) |> ignore -[] +[] let ``Creation of a bound value fails if the name contains dots`` () = use fsiSession = createFsiSession () Assert.Throws(fun () -> fsiSession.AddBoundValue("x.x", 1)) |> ignore -[] +[] let ``Creation of a bound value fails if the value passed is null`` () = use fsiSession = createFsiSession () @@ -364,13 +365,13 @@ let ``Creation of a bound value fails if the value passed is null`` () = type CustomType = { X: int } -[] +[] let ``Creation of a bound value succeeds if the value contains types from assemblies that are not referenced in the session, due to implicit resolution`` () = use fsiSession = createFsiSession () fsiSession.AddBoundValue("x", { X = 1 }) -[] +[] let ``Creation of a bound value succeeds if the value contains types from assemblies that are not referenced in the session, due to implicit resolution, and then doing some evaluation`` () = use fsiSession = createFsiSession () @@ -378,20 +379,20 @@ let ``Creation of a bound value succeeds if the value contains types from assemb fsiSession.EvalInteraction("let y = { x with X = 5 }") let boundValues = fsiSession.GetBoundValues() - Assert.AreEqual(2, boundValues.Length) + Assert.shouldBe(2, boundValues.Length) let v1 = boundValues.[0] let v2 = boundValues.[1] - Assert.AreEqual("x", v1.Name) - Assert.AreEqual({ X = 1 }, v1.Value.ReflectionValue) - Assert.AreEqual(typeof, v1.Value.ReflectionType) + Assert.shouldBe("x", v1.Name) + Assert.shouldBe({ X = 1 }, v1.Value.ReflectionValue) + Assert.shouldBe(typeof, v1.Value.ReflectionType) - Assert.AreEqual("y", v2.Name) - Assert.AreEqual({ X = 5 }, v2.Value.ReflectionValue) - Assert.AreEqual(typeof, v2.Value.ReflectionType) + Assert.shouldBe("y", v2.Name) + Assert.shouldBe({ X = 5 }, v2.Value.ReflectionValue) + Assert.shouldBe(typeof, v2.Value.ReflectionType) -[] +[] let ``Creation of a bound value, of type ResizeArray, succeeds`` () = use fsiSession = createFsiSession () @@ -402,19 +403,19 @@ let ``Creation of a bound value, of type ResizeArray, succeeds`` () = fsiSession.AddBoundValue("xs", xs) let boundValues = fsiSession.GetBoundValues() - Assert.AreEqual(1, boundValues.Length) + Assert.shouldBe(1, boundValues.Length) let v1 = boundValues.[0] - Assert.AreEqual("xs", v1.Name) - Assert.AreEqual(xs, v1.Value.ReflectionValue) - Assert.AreEqual(typeof>, v1.Value.ReflectionType) + Assert.shouldBe("xs", v1.Name) + Assert.shouldBe(xs, v1.Value.ReflectionValue) + Assert.shouldBe(typeof>, v1.Value.ReflectionType) type CustomType2() = member _.Message = "hello" -[] +[] let ``Creation of a bound value succeeds if the value contains types from assemblies that are not referenced in the session, due to implicit resolution, and then use a member from it`` () = use fsiSession = createFsiSession () @@ -423,19 +424,19 @@ let ``Creation of a bound value succeeds if the value contains types from assemb let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("x", boundValue.Name) - Assert.AreEqual(value, boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("x", boundValue.Name) + Assert.shouldBe(value, boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) fsiSession.EvalInteraction("let x = x.Message") let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("x", boundValue.Name) - Assert.AreEqual("hello", boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("x", boundValue.Name) + Assert.shouldBe("hello", boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) -[] +[] let ``Creation of a bound value succeeds if the value contains generic types from assemblies that are not referenced in the session, due to implicit resolution, and then use a member from it`` () = use fsiSession = createFsiSession () @@ -446,19 +447,19 @@ let ``Creation of a bound value succeeds if the value contains generic types fro let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("x", boundValue.Name) - Assert.AreEqual(value, boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof>, boundValue.Value.ReflectionType) + Assert.shouldBe("x", boundValue.Name) + Assert.shouldBe(value, boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof>, boundValue.Value.ReflectionType) fsiSession.EvalInteraction("let x = x.[0].Message") let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("x", boundValue.Name) - Assert.AreEqual("hello", boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("x", boundValue.Name) + Assert.shouldBe("hello", boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) -[] +[] let ``Creation of a bound value succeeds if the value contains two generic types from assemblies that are not referenced in the session, due to implicit resolution`` () = use fsiSession = createFsiSession () @@ -468,11 +469,11 @@ let ``Creation of a bound value succeeds if the value contains two generic types let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual("x", boundValue.Name) - Assert.AreEqual(value, boundValue.Value.ReflectionValue) - Assert.AreEqual(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe("x", boundValue.Name) + Assert.shouldBe(value, boundValue.Value.ReflectionValue) + Assert.shouldBe(typeof, boundValue.Value.ReflectionType) -[] +[] let ``Creation of a bound value fails if the value contains types from a dynamic assembly`` () = use fsiSession = createFsiSession () @@ -483,18 +484,18 @@ type TypeInDynamicAssembly() = class end fsiSession.AddBoundValue("x", TypeInDynamicAssembly())""") match res with - | Choice2Of2 ex -> Assert.AreEqual(typeof, ex.GetType()) + | Choice2Of2 ex -> Assert.shouldBe(typeof, ex.GetType()) | _ -> failwith "Expected an exception" type internal NonPublicCustomType() = class end -[] +[] let ``Creation of a bound value fails if the value's type is not public`` () = use fsiSession = createFsiSession () Assert.Throws(fun () -> fsiSession.AddBoundValue("x", NonPublicCustomType())) |> ignore -[] +[] let ``Creation of a bound value succeeds if the value is a partial application function type`` () = use fsiSession = createFsiSession () @@ -502,9 +503,9 @@ let ``Creation of a bound value succeeds if the value is a partial application f let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual(typeof FsiEvaluationSession>, boundValue.Value.ReflectionType) + Assert.shouldBe(typeof FsiEvaluationSession>, boundValue.Value.ReflectionType) -[] +[] let ``Creation of a bound value succeeds if the value is a partial application function type with four arguments`` () = use fsiSession = createFsiSession () @@ -516,9 +517,9 @@ let ``Creation of a bound value succeeds if the value is a partial application f let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual(typeof int -> int>, boundValue.Value.ReflectionType) + Assert.shouldBe(typeof int -> int>, boundValue.Value.ReflectionType) -[] +[] let ``Creation of a bound value succeeds if the value is a lambda`` () = use fsiSession = createFsiSession () @@ -526,7 +527,7 @@ let ``Creation of a bound value succeeds if the value is a lambda`` () = let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual(typeof int -> int -> int>, boundValue.Value.ReflectionType) + Assert.shouldBe(typeof int -> int -> int>, boundValue.Value.ReflectionType) type TestFSharpFunc() = inherit FSharpFunc() @@ -536,7 +537,7 @@ type TestFSharpFunc() = type ``Test2FSharp @ Func``() = inherit TestFSharpFunc() -[] +[] let ``Creation of a bound value succeeds if the value is a type that inherits FSharpFunc`` () = use fsiSession = createFsiSession () @@ -544,4 +545,4 @@ let ``Creation of a bound value succeeds if the value is a type that inherits FS let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.AreEqual(typeof<``Test2FSharp @ Func``>, boundValue.Value.ReflectionType) \ No newline at end of file + Assert.shouldBe(typeof<``Test2FSharp @ Func``>, boundValue.Value.ReflectionType) diff --git a/tests/FSharp.Compiler.UnitTests/HashIfExpression.fs b/tests/FSharp.Compiler.UnitTests/HashIfExpression.fs index 4aef3bb3310..b0cb9876c34 100644 --- a/tests/FSharp.Compiler.UnitTests/HashIfExpression.fs +++ b/tests/FSharp.Compiler.UnitTests/HashIfExpression.fs @@ -5,7 +5,8 @@ namespace FSharp.Compiler.UnitTests open System open System.Text -open NUnit.Framework +open Xunit +open FSharp.Test.Utilities open Internal.Utilities open Internal.Utilities.Text.Lexing @@ -18,7 +19,6 @@ open FSharp.Compiler.Features open FSharp.Compiler.ParseHelpers open FSharp.Compiler.SyntaxTree -[] type HashIfExpression() = let preludes = [|"#if "; "#elif "|] @@ -94,7 +94,7 @@ type HashIfExpression() = member this.TearDown() = tearDown () - [] + [] member this.PositiveParserTestCases()= let errors, warnings, parser = createParser () @@ -151,11 +151,11 @@ type HashIfExpression() = let failure = String.Join ("\n", fs) - Assert.AreEqual("", failure) + Assert.shouldBe("", failure) () - [] + [] member this.NegativeParserTestCases()= let errors, warnings, parser = createParser () @@ -214,9 +214,9 @@ type HashIfExpression() = let fails = String.Join ("\n", fs) - Assert.AreEqual("", fails) + Assert.shouldBe("", fails) - [] + [] member this.LexerIfdefEvalTestCases()= let failures = ResizeArray () @@ -267,4 +267,4 @@ type HashIfExpression() = let fails = String.Join ("\n", fs) - Assert.AreEqual("", fails) + Assert.shouldBe("", fails) diff --git a/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs b/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs index e422e5a499b..c94ffa48465 100644 --- a/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs +++ b/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs @@ -3,66 +3,67 @@ namespace FSharp.Compiler.UnitTests open System open System.Text -open NUnit.Framework +open Xunit +open FSharp.Test.Utilities open FSharp.Compiler -[] + type ManglingNamesOfProvidedTypesWithSingleParameter() = - [] + [] member this.MangleWithNonDefaultValue() = let mangled = PrettyNaming.computeMangledNameWithoutDefaultArgValues("MyNamespace.Test", [| "xyz" |], [| "Foo", Some "abc" |]) - Assert.AreEqual("MyNamespace.Test,Foo=\"xyz\"", mangled) + Assert.shouldBe("MyNamespace.Test,Foo=\"xyz\"", mangled) - [] + [] member this.MangleWithDefaultValue() = let mangled = PrettyNaming.computeMangledNameWithoutDefaultArgValues("MyNamespace.Test", [| "xyz" |], [| "Foo", Some "xyz" |]) - Assert.AreEqual("MyNamespace.Test", mangled) + Assert.shouldBe("MyNamespace.Test", mangled) - [] + [] member this.DemangleNonDefaultValue() = let name, parameters = PrettyNaming.demangleProvidedTypeName "MyNamespace.Test,Foo=\"xyz\"" - Assert.AreEqual("MyNamespace.Test", name) - Assert.AreEqual([| "Foo", "xyz" |], parameters) + Assert.shouldBe("MyNamespace.Test", name) + Assert.shouldBe([| "Foo", "xyz" |], parameters) - [] + [] member this.DemangleDefaultValue() = let name, parameters = PrettyNaming.demangleProvidedTypeName "MyNamespace.Test," - Assert.AreEqual("MyNamespace.Test", name) - Assert.AreEqual([||], parameters) + Assert.shouldBe("MyNamespace.Test", name) + Assert.shouldBe([||], parameters) - [] + [] member this.DemangleNewDefaultValue() = let name, parameters = PrettyNaming.demangleProvidedTypeName "MyNamespace.Test" - Assert.AreEqual("MyNamespace.Test", name) - Assert.AreEqual([||], parameters) + Assert.shouldBe("MyNamespace.Test", name) + Assert.shouldBe([||], parameters) + -[] type ManglingNamesOfProvidedTypesWithMultipleParameter() = - [] + [] member this.MangleWithNonDefaultValue() = let mangled = PrettyNaming.computeMangledNameWithoutDefaultArgValues ("MyNamespace.Test", [| "xyz"; "abc" |], [| "Foo", Some "foo" "Foo2", Some "foo2" |]) - Assert.AreEqual("MyNamespace.Test,Foo=\"xyz\",Foo2=\"abc\"", mangled) + Assert.shouldBe("MyNamespace.Test,Foo=\"xyz\",Foo2=\"abc\"", mangled) - [] + [] member this.MangleWithDefaultValue() = let mangled = PrettyNaming.computeMangledNameWithoutDefaultArgValues ("MyNamespace.Test", [| "xyz"; "abc" |], [| "Foo", Some "xyz" "Foo2", Some "abc" |]) - Assert.AreEqual("MyNamespace.Test", mangled) + Assert.shouldBe("MyNamespace.Test", mangled) - [] + [] member this.DemangleMultiParameter() = let name, parameters = PrettyNaming.demangleProvidedTypeName "TestType,Foo=\"xyz\",Foo2=\"abc\"" - Assert.AreEqual("TestType", name) - Assert.AreEqual([| "Foo", "xyz" + Assert.shouldBe("TestType", name) + Assert.shouldBe([| "Foo", "xyz" "Foo2", "abc" |], parameters) \ No newline at end of file diff --git a/tests/FSharp.Compiler.UnitTests/NunitHelpers.fs b/tests/FSharp.Compiler.UnitTests/NunitHelpers.fs index 89fb1cfc5ba..37070f87b03 100644 --- a/tests/FSharp.Compiler.UnitTests/NunitHelpers.fs +++ b/tests/FSharp.Compiler.UnitTests/NunitHelpers.fs @@ -7,7 +7,7 @@ module Assert = let inline failf fmt = Printf.kprintf fail fmt let inline areEqual (expected: ^T) (actual: ^T) = - Assert.AreEqual(expected, actual) + Assert.shouldBe(expected, actual) module StringAssert = diff --git a/tests/FSharp.Compiler.UnitTests/ProductVersion.fs b/tests/FSharp.Compiler.UnitTests/ProductVersion.fs index aa2d1168898..14f15f09858 100644 --- a/tests/FSharp.Compiler.UnitTests/ProductVersion.fs +++ b/tests/FSharp.Compiler.UnitTests/ProductVersion.fs @@ -3,7 +3,8 @@ open System open System.IO open System.Text -open NUnit.Framework +open Xunit +open FSharp.Test.Utilities open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.Driver.MainModuleBuilder @@ -14,47 +15,47 @@ module FileVersionTest = let fileVersionAttrName = typeof.FullName - [] + [] let parseILVersion () = - "0.0.0.0" |> parseILVersion |> Assert.areEqual (ILVersionInfo(0us,0us,0us,0us)) - "1.2.3.4" |> parseILVersion |> Assert.areEqual (ILVersionInfo(1us,2us,3us,4us)) + "0.0.0.0" |> parseILVersion |> Assert.shouldBe (ILVersionInfo(0us,0us,0us,0us)) + "1.2.3.4" |> parseILVersion |> Assert.shouldBe (ILVersionInfo(1us,2us,3us,4us)) - [] + [] let ``should use AssemblyFileVersionAttribute if set`` () = - let findStringAttr n = n |> Assert.areEqual fileVersionAttrName; Some "1.2.3.4" - fileVersion findStringAttr (ILVersionInfo(1us,0us,0us,0us)) |> Assert.areEqual (ILVersionInfo(1us,2us,3us,4us)) + let findStringAttr n = n |> Assert.shouldBe fileVersionAttrName; Some "1.2.3.4" + fileVersion findStringAttr (ILVersionInfo(1us,0us,0us,0us)) |> Assert.shouldBe (ILVersionInfo(1us,2us,3us,4us)) - [] + [] let ``should fallback if AssemblyFileVersionAttribute is not a valid version`` () = fileVersion (fun _ -> Some "1.2a.3.3") (ILVersionInfo(3us,7us,8us,6us)) - |> Assert.areEqual (ILVersionInfo(3us,7us,8us,6us)) + |> Assert.shouldBe (ILVersionInfo(3us,7us,8us,6us)) - [] + [] let ``should fallback to assemblyVersion if AssemblyFileVersionAttribute not set`` () = - let findStringAttr n = n |> Assert.areEqual fileVersionAttrName; None; - fileVersion findStringAttr (ILVersionInfo(1us,0us,0us,4us)) |> Assert.areEqual (ILVersionInfo(1us,0us,0us,4us)) + let findStringAttr n = n |> Assert.shouldBe fileVersionAttrName; None; + fileVersion findStringAttr (ILVersionInfo(1us,0us,0us,4us)) |> Assert.shouldBe (ILVersionInfo(1us,0us,0us,4us)) module ProductVersionTest = let informationalVersionAttrName = typeof.FullName let fileVersionAttrName = typeof.FullName - [] + [] let ``should use AssemblyInformationalVersionAttribute if set`` () = let mutable args = [] let findStrAttr x = args <- List.append args [x]; Some "12.34.56.78" - productVersion findStrAttr (ILVersionInfo(1us,0us,0us,6us)) |> Assert.areEqual "12.34.56.78" - args |> Assert.areEqual [ informationalVersionAttrName ] + productVersion findStrAttr (ILVersionInfo(1us,0us,0us,6us)) |> Assert.shouldBe "12.34.56.78" + args |> Assert.shouldBe [ informationalVersionAttrName ] - [] + [] let ``should fallback if AssemblyInformationalVersionAttribute is not a valid version`` () = productVersion (fun _ -> Some "1.2.3-main (build #12)") (ILVersionInfo(1us,0us,0us,6us)) - |> Assert.areEqual "1.2.3-main (build #12)" + |> Assert.shouldBe "1.2.3-main (build #12)" - [] + [] let ``should fallback to fileVersion if AssemblyInformationalVersionAttribute not set or empty`` () = - productVersion (fun _ -> None) (ILVersionInfo(3us,2us,1us,0us)) |> Assert.areEqual "3.2.1.0" - productVersion (fun _ -> Some "") (ILVersionInfo(3us,2us,1us,0us)) |> Assert.areEqual "3.2.1.0" + productVersion (fun _ -> None) (ILVersionInfo(3us,2us,1us,0us)) |> Assert.shouldBe "3.2.1.0" + productVersion (fun _ -> Some "") (ILVersionInfo(3us,2us,1us,0us)) |> Assert.shouldBe "3.2.1.0" let validValues () = let max = System.UInt16.MaxValue @@ -65,10 +66,10 @@ module ProductVersionTest = "3213.57843.32382.59493", ILVersionInfo(3213us,57843us,32382us,59493us) (sprintf "%d.%d.%d.%d" max max max max), ILVersionInfo(max,max,max,max) ] - [] + [] let ``should use values if valid major.minor.revision.build version format`` () = for (v, expected) in validValues() do - v |> productVersionToILVersionInfo |> Assert.areEqual expected + v |> productVersionToILVersionInfo |> Assert.shouldBe expected let invalidValues () = [ "1.2.3.4", ILVersionInfo(1us,2us,3us,4us) @@ -83,7 +84,7 @@ module ProductVersionTest = "70000.80000.90000.100000", ILVersionInfo(0us,0us,0us,0us) (sprintf "%d.70000.80000.90000" System.UInt16.MaxValue), ILVersionInfo(System.UInt16.MaxValue,0us,0us,0us) ] - [] + [] let ``should zero starting from first invalid version part`` () = for (v, expected) in invalidValues() do - v |> productVersionToILVersionInfo |> Assert.areEqual expected + v |> productVersionToILVersionInfo |> Assert.shouldBe expected diff --git a/tests/FSharp.Compiler.UnitTests/SuggestionBuffer.fs b/tests/FSharp.Compiler.UnitTests/SuggestionBuffer.fs index 0a0584088c9..ef2da5ca0f9 100644 --- a/tests/FSharp.Compiler.UnitTests/SuggestionBuffer.fs +++ b/tests/FSharp.Compiler.UnitTests/SuggestionBuffer.fs @@ -1,20 +1,21 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. namespace FSharp.Compiler.UnitTests -open NUnit.Framework +open Xunit +open FSharp.Test.Utilities + -[] module SuggestionBuffer = open FSharp.Compiler.ErrorResolutionHints - [] + [] let NewBufferShouldBeEmpty() = let buffer = SuggestionBuffer("abdef") Assert.IsFalse buffer.Disabled Assert.IsEmpty buffer - [] + [] let BufferShouldOnlyAcceptSimilarElements() = let buffer = SuggestionBuffer("abcd") buffer.Add("abce") @@ -22,9 +23,9 @@ module SuggestionBuffer = let results = Array.ofSeq buffer - Assert.areEqual [| "abce" |] results + Assert.shouldBe [| "abce" |] results - [] + [] let SmallIdentifierShouldBeIgnored() = let buffer = SuggestionBuffer("ab") @@ -41,9 +42,9 @@ module SuggestionBuffer = let results = Array.ofSeq buffer Assert.IsTrue buffer.Disabled - Assert.areEqual [||] results + Assert.shouldBe [||] results - [] + [] let BufferShouldOnlyTakeTop5Elements() = let buffer = SuggestionBuffer("abcd") buffer.Add("abce") @@ -56,9 +57,9 @@ module SuggestionBuffer = let results = Array.ofSeq buffer - Assert.areEqual [| "abce"; "abcg"; "abch"; "abci"; "abcj"|] results + Assert.shouldBe [| "abce"; "abcg"; "abch"; "abci"; "abcj"|] results - [] + [] let BufferShouldUseEarlierElementsIfTheyHaveSameScore() = let buffer = SuggestionBuffer("abcd") buffer.Add("abce") @@ -70,10 +71,10 @@ module SuggestionBuffer = let results = Array.ofSeq buffer - Assert.areEqual [| "abce"; "abcf"; "abcg"; "abch"; "abci"|] results + Assert.shouldBe [| "abce"; "abcf"; "abcg"; "abch"; "abci"|] results - [] + [] let BufferShouldDisableItselfIfItSeesTheOriginalIdentifier() = let buffer = SuggestionBuffer("abcd") buffer.Add("abce") @@ -90,7 +91,7 @@ module SuggestionBuffer = Assert.IsTrue buffer.Disabled Assert.IsEmpty buffer - [] + [] let BufferShouldIgnoreSmallIdentifiers() = let buffer = SuggestionBuffer("abd") buffer.Add("abce") @@ -100,4 +101,4 @@ module SuggestionBuffer = let results = Array.ofSeq buffer - Assert.areEqual [| "abc"; "abce" |] results \ No newline at end of file + Assert.shouldBe [| "abc"; "abce" |] results \ No newline at end of file diff --git a/tests/FSharp.TestHelpers/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs similarity index 99% rename from tests/FSharp.TestHelpers/CompilerAssert.fs rename to tests/FSharp.Test.Utilities/CompilerAssert.fs index 92552d17ad6..873a2166517 100644 --- a/tests/FSharp.TestHelpers/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace FSharp.TestHelpers +namespace FSharp.Test.Utilities open System open System.Diagnostics @@ -19,7 +19,7 @@ open NUnit.Framework open System.Reflection.Emit open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.CSharp -open FSharp.TestHelpers.Utilities +open FSharp.Test.Utilities.Utilities [] type ILVerifier (dllFilePath: string) = diff --git a/tests/FSharp.TestHelpers/Directory.Build.props b/tests/FSharp.Test.Utilities/Directory.Build.props similarity index 100% rename from tests/FSharp.TestHelpers/Directory.Build.props rename to tests/FSharp.Test.Utilities/Directory.Build.props diff --git a/tests/FSharp.TestHelpers/FSharp.TestHelpers.fsproj b/tests/FSharp.Test.Utilities/FSharp.TestHelpers.fsproj similarity index 93% rename from tests/FSharp.TestHelpers/FSharp.TestHelpers.fsproj rename to tests/FSharp.Test.Utilities/FSharp.TestHelpers.fsproj index 0dc048b156d..3e186453ae8 100644 --- a/tests/FSharp.TestHelpers/FSharp.TestHelpers.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.TestHelpers.fsproj @@ -39,6 +39,7 @@ - + + diff --git a/tests/FSharp.TestHelpers/ILChecker.fs b/tests/FSharp.Test.Utilities/ILChecker.fs similarity index 99% rename from tests/FSharp.TestHelpers/ILChecker.fs rename to tests/FSharp.Test.Utilities/ILChecker.fs index 9ddc810b81b..9873a6ea816 100644 --- a/tests/FSharp.TestHelpers/ILChecker.fs +++ b/tests/FSharp.Test.Utilities/ILChecker.fs @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace FSharp.TestHelpers +namespace FSharp.Test.Utilities open System open System.IO diff --git a/tests/FSharp.TestHelpers/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs similarity index 100% rename from tests/FSharp.TestHelpers/TestFramework.fs rename to tests/FSharp.Test.Utilities/TestFramework.fs diff --git a/tests/FSharp.TestHelpers/Utilities.fs b/tests/FSharp.Test.Utilities/Utilities.fs similarity index 99% rename from tests/FSharp.TestHelpers/Utilities.fs rename to tests/FSharp.Test.Utilities/Utilities.fs index ebf201b0f14..8509a0cee5b 100644 --- a/tests/FSharp.TestHelpers/Utilities.fs +++ b/tests/FSharp.Test.Utilities/Utilities.fs @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace FSharp.TestHelpers +namespace FSharp.Test.Utilities open System open System.IO @@ -8,7 +8,7 @@ open System.Collections.Immutable open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.CSharp open System.Diagnostics -open FSharp.TestHelpers +open FSharp.Test.Utilities // This file mimics how Roslyn handles their compilation references for compilation testing diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/LiteralValue.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/LiteralValue.fs index d54923e66e4..8717a7dc2bd 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/LiteralValue.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/LiteralValue.fs @@ -2,7 +2,7 @@ namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL -open FSharp.TestHelpers +open FSharp.Test.Utilities open NUnit.Framework [] diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs index 1e6e7b6f51b..a13eb1e75a6 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL open FSharp.Compiler.UnitTests -open FSharp.TestHelpers +open FSharp.Test.Utilities open NUnit.Framework [] diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticLinkTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticLinkTests.fs index af2180b93fa..b4c11409226 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticLinkTests.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticLinkTests.fs @@ -4,7 +4,7 @@ namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL open System.IO open System.Reflection -open FSharp.TestHelpers +open FSharp.Test.Utilities open NUnit.Framework [] diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs index bb53ec0c749..02d3d54d959 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs @@ -2,7 +2,7 @@ namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL -open FSharp.TestHelpers +open FSharp.Test.Utilities open NUnit.Framework [] diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/TailCalls.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/TailCalls.fs index 018ff10eeae..cc7b5f04ddd 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/TailCalls.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/TailCalls.fs @@ -2,7 +2,7 @@ namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL -open FSharp.TestHelpers +open FSharp.Test.Utilities open NUnit.Framework [] diff --git a/tests/fsharp/Compiler/Conformance/BasicGrammarElements/BasicConstants.fs b/tests/fsharp/Compiler/Conformance/BasicGrammarElements/BasicConstants.fs index a7e75b4cc5c..912fb29091f 100644 --- a/tests/fsharp/Compiler/Conformance/BasicGrammarElements/BasicConstants.fs +++ b/tests/fsharp/Compiler/Conformance/BasicGrammarElements/BasicConstants.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/Conformance/DataExpressions/ComputationExpressions.fs b/tests/fsharp/Compiler/Conformance/DataExpressions/ComputationExpressions.fs index 9b596c4e9e2..240583f704d 100644 --- a/tests/fsharp/Compiler/Conformance/DataExpressions/ComputationExpressions.fs +++ b/tests/fsharp/Compiler/Conformance/DataExpressions/ComputationExpressions.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/ConstraintSolver/MemberConstraints.fs b/tests/fsharp/Compiler/ConstraintSolver/MemberConstraints.fs index 3e52be3ccf3..e2be187bd78 100644 --- a/tests/fsharp/Compiler/ConstraintSolver/MemberConstraints.fs +++ b/tests/fsharp/Compiler/ConstraintSolver/MemberConstraints.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/ConstraintSolver/PrimitiveConstraints.fs b/tests/fsharp/Compiler/ConstraintSolver/PrimitiveConstraints.fs index ef422e579fd..c86f85eb04e 100644 --- a/tests/fsharp/Compiler/ConstraintSolver/PrimitiveConstraints.fs +++ b/tests/fsharp/Compiler/ConstraintSolver/PrimitiveConstraints.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/ErrorMessages/AccessOfTypeAbbreviationTests.fs b/tests/fsharp/Compiler/ErrorMessages/AccessOfTypeAbbreviationTests.fs index 334448ce725..f6fc14bbef5 100644 --- a/tests/fsharp/Compiler/ErrorMessages/AccessOfTypeAbbreviationTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/AccessOfTypeAbbreviationTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] @@ -73,4 +73,4 @@ module Library = module Library = type Hidden = Hidden of unit type Exported = Hidden - """ \ No newline at end of file + """ diff --git a/tests/fsharp/Compiler/ErrorMessages/AssignmentErrorTests.fs b/tests/fsharp/Compiler/ErrorMessages/AssignmentErrorTests.fs index bc9fca86d7d..c1226c4ff93 100644 --- a/tests/fsharp/Compiler/ErrorMessages/AssignmentErrorTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/AssignmentErrorTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] @@ -19,4 +19,4 @@ x <- 20 FSharpErrorSeverity.Error 27 (3, 1, 3, 8) - "This value is not mutable. Consider using the mutable keyword, e.g. 'let mutable x = expression'." \ No newline at end of file + "This value is not mutable. Consider using the mutable keyword, e.g. 'let mutable x = expression'." diff --git a/tests/fsharp/Compiler/ErrorMessages/ClassesTests.fs b/tests/fsharp/Compiler/ErrorMessages/ClassesTests.fs index 245cade94f0..f02837ef0c3 100644 --- a/tests/fsharp/Compiler/ErrorMessages/ClassesTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/ClassesTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/ErrorMessages/ConstructorTests.fs b/tests/fsharp/Compiler/ErrorMessages/ConstructorTests.fs index 685d867b5cd..be7e5823391 100644 --- a/tests/fsharp/Compiler/ErrorMessages/ConstructorTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/ConstructorTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/ErrorMessages/DontSuggestTests.fs b/tests/fsharp/Compiler/ErrorMessages/DontSuggestTests.fs index f9e95610286..f7b3cc2cb05 100644 --- a/tests/fsharp/Compiler/ErrorMessages/DontSuggestTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/DontSuggestTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/ErrorMessages/ElseBranchHasWrongTypeTests.fs b/tests/fsharp/Compiler/ErrorMessages/ElseBranchHasWrongTypeTests.fs index d0e46f7402b..ed5b9a44863 100644 --- a/tests/fsharp/Compiler/ErrorMessages/ElseBranchHasWrongTypeTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/ElseBranchHasWrongTypeTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/ErrorMessages/InvalidNumericLiteralTests.fs b/tests/fsharp/Compiler/ErrorMessages/InvalidNumericLiteralTests.fs index 6051f4345b6..6c8be402844 100644 --- a/tests/fsharp/Compiler/ErrorMessages/InvalidNumericLiteralTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/InvalidNumericLiteralTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] @@ -18,4 +18,4 @@ let foo = 1up // int FSharpErrorSeverity.Error 1156 (2, 11, 2, 14) - "This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger)." \ No newline at end of file + "This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger)." diff --git a/tests/fsharp/Compiler/ErrorMessages/MissingElseBranch.fs b/tests/fsharp/Compiler/ErrorMessages/MissingElseBranch.fs index 0e01e2e3558..370b4c24053 100644 --- a/tests/fsharp/Compiler/ErrorMessages/MissingElseBranch.fs +++ b/tests/fsharp/Compiler/ErrorMessages/MissingElseBranch.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/ErrorMessages/MissingExpressionTests.fs b/tests/fsharp/Compiler/ErrorMessages/MissingExpressionTests.fs index 8d8cf82463e..b00833e418a 100644 --- a/tests/fsharp/Compiler/ErrorMessages/MissingExpressionTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/MissingExpressionTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] @@ -20,4 +20,4 @@ for x in 0 .. 10 do FSharpErrorSeverity.Error 588 (4,5,4,8) - "The block following this 'let' is unfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving this block an explicit result." \ No newline at end of file + "The block following this 'let' is unfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving this block an explicit result." diff --git a/tests/fsharp/Compiler/ErrorMessages/ModuleAbbreviationTests.fs b/tests/fsharp/Compiler/ErrorMessages/ModuleAbbreviationTests.fs index ee0351ccea8..b67bb8ca8b5 100644 --- a/tests/fsharp/Compiler/ErrorMessages/ModuleAbbreviationTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/ModuleAbbreviationTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] @@ -18,4 +18,4 @@ module public L1 = List FSharpErrorSeverity.Error 536 (2, 1, 2, 7) - "The 'Public' accessibility attribute is not allowed on module abbreviation. Module abbreviations are always private." \ No newline at end of file + "The 'Public' accessibility attribute is not allowed on module abbreviation. Module abbreviations are always private." diff --git a/tests/fsharp/Compiler/ErrorMessages/NameResolutionTests.fs b/tests/fsharp/Compiler/ErrorMessages/NameResolutionTests.fs index dbe1a11e0b6..4a94339fe18 100644 --- a/tests/fsharp/Compiler/ErrorMessages/NameResolutionTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/NameResolutionTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] @@ -43,4 +43,4 @@ let r = { Size=3; Height=4; Wall=1 } FSharpErrorSeverity.Error 39 (9, 29, 9, 33) - "The record label 'Wall' is not defined. Maybe you want one of the following:\r\n Walls\r\n Wallis" \ No newline at end of file + "The record label 'Wall' is not defined. Maybe you want one of the following:\r\n Walls\r\n Wallis" diff --git a/tests/fsharp/Compiler/ErrorMessages/SuggestionsTests.fs b/tests/fsharp/Compiler/ErrorMessages/SuggestionsTests.fs index 9e09f7fd121..e6f44d2430f 100644 --- a/tests/fsharp/Compiler/ErrorMessages/SuggestionsTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/SuggestionsTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] @@ -318,4 +318,4 @@ let x = FSharpErrorSeverity.Error 39 (11, 15, 11, 19) - "The type 'MyUnion' does not define the field, constructor or member 'Cas1'. Maybe you want one of the following:\r\n Case1\r\n Case2" \ No newline at end of file + "The type 'MyUnion' does not define the field, constructor or member 'Cas1'. Maybe you want one of the following:\r\n Case1\r\n Case2" diff --git a/tests/fsharp/Compiler/ErrorMessages/TypeMismatchTests.fs b/tests/fsharp/Compiler/ErrorMessages/TypeMismatchTests.fs index 4e38a60dcb5..58557c82cd4 100644 --- a/tests/fsharp/Compiler/ErrorMessages/TypeMismatchTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/TypeMismatchTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs b/tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs index 9ceadab112e..3fee1050ef9 100644 --- a/tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs +++ b/tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/ErrorMessages/UpcastDowncastTests.fs b/tests/fsharp/Compiler/ErrorMessages/UpcastDowncastTests.fs index cb3e5c3a8ba..384164bff22 100644 --- a/tests/fsharp/Compiler/ErrorMessages/UpcastDowncastTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/UpcastDowncastTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/ErrorMessages/WarnExpressionTests.fs b/tests/fsharp/Compiler/ErrorMessages/WarnExpressionTests.fs index d83a53fff0a..1df40553ce7 100644 --- a/tests/fsharp/Compiler/ErrorMessages/WarnExpressionTests.fs +++ b/tests/fsharp/Compiler/ErrorMessages/WarnExpressionTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/ErrorMessages/WrongSyntaxInForLoop.fs b/tests/fsharp/Compiler/ErrorMessages/WrongSyntaxInForLoop.fs index ef826ef8da0..9747bbfa6aa 100644 --- a/tests/fsharp/Compiler/ErrorMessages/WrongSyntaxInForLoop.fs +++ b/tests/fsharp/Compiler/ErrorMessages/WrongSyntaxInForLoop.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/Language/AnonRecordTests.fs b/tests/fsharp/Compiler/Language/AnonRecordTests.fs index 73d6c769cee..05276a13c34 100644 --- a/tests/fsharp/Compiler/Language/AnonRecordTests.fs +++ b/tests/fsharp/Compiler/Language/AnonRecordTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/Language/ByrefTests.fs b/tests/fsharp/Compiler/Language/ByrefTests.fs index 12d600fc512..92a45f3a0b5 100644 --- a/tests/fsharp/Compiler/Language/ByrefTests.fs +++ b/tests/fsharp/Compiler/Language/ByrefTests.fs @@ -3,8 +3,8 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers -open FSharp.TestHelpers.Utilities +open FSharp.Test.Utilities +open FSharp.Test.Utilities.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/Language/CompilerDirectiveTests.fs b/tests/fsharp/Compiler/Language/CompilerDirectiveTests.fs index 0ce121fcdb4..f0c50060e60 100644 --- a/tests/fsharp/Compiler/Language/CompilerDirectiveTests.fs +++ b/tests/fsharp/Compiler/Language/CompilerDirectiveTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/Language/CustomCollectionTests.fs b/tests/fsharp/Compiler/Language/CustomCollectionTests.fs index 377f0469128..fe8b5aa5956 100644 --- a/tests/fsharp/Compiler/Language/CustomCollectionTests.fs +++ b/tests/fsharp/Compiler/Language/CustomCollectionTests.fs @@ -1,7 +1,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs b/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs index f5f269b8a0e..fbd968178f1 100644 --- a/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs +++ b/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs @@ -3,8 +3,8 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers -open FSharp.TestHelpers.Utilities +open FSharp.Test.Utilities +open FSharp.Test.Utilities.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/Language/FixedIndexSliceTests.fs b/tests/fsharp/Compiler/Language/FixedIndexSliceTests.fs index 18539b41539..5dc42ccf294 100644 --- a/tests/fsharp/Compiler/Language/FixedIndexSliceTests.fs +++ b/tests/fsharp/Compiler/Language/FixedIndexSliceTests.fs @@ -1,7 +1,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/Language/HatDesugaringTests.fs b/tests/fsharp/Compiler/Language/HatDesugaringTests.fs index c0c861b7c24..f692eaf87c2 100644 --- a/tests/fsharp/Compiler/Language/HatDesugaringTests.fs +++ b/tests/fsharp/Compiler/Language/HatDesugaringTests.fs @@ -1,7 +1,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/Language/OpenStaticClasses.fs b/tests/fsharp/Compiler/Language/OpenStaticClasses.fs index 1a6c2388b9a..deff83a5c42 100644 --- a/tests/fsharp/Compiler/Language/OpenStaticClasses.fs +++ b/tests/fsharp/Compiler/Language/OpenStaticClasses.fs @@ -4,7 +4,7 @@ namespace FSharp.Compiler.UnitTests open FSharp.Compiler.SourceCodeServices open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities (* @@ -186,4 +186,4 @@ module OpenAFieldFromMath = // TODO - wait for Will's integration of testing changes that makes this easlier // [] - // let ``OpenStaticClassesTests - InternalsVisibleWhenHavingAnIVT - langversion:preview``() = ... \ No newline at end of file + // let ``OpenStaticClassesTests - InternalsVisibleWhenHavingAnIVT - langversion:preview``() = ... diff --git a/tests/fsharp/Compiler/Language/OptionalInteropTests.fs b/tests/fsharp/Compiler/Language/OptionalInteropTests.fs index 199b758da4e..443c4f47468 100644 --- a/tests/fsharp/Compiler/Language/OptionalInteropTests.fs +++ b/tests/fsharp/Compiler/Language/OptionalInteropTests.fs @@ -4,8 +4,8 @@ namespace FSharp.Compiler.UnitTests open System.Collections.Immutable open NUnit.Framework -open FSharp.TestHelpers -open FSharp.TestHelpers.Utilities +open FSharp.Test.Utilities +open FSharp.Test.Utilities.Utilities open FSharp.Compiler.SourceCodeServices open Microsoft.CodeAnalysis diff --git a/tests/fsharp/Compiler/Language/SlicingQuotationTests.fs b/tests/fsharp/Compiler/Language/SlicingQuotationTests.fs index 3e4565c1a83..f34e0510712 100644 --- a/tests/fsharp/Compiler/Language/SlicingQuotationTests.fs +++ b/tests/fsharp/Compiler/Language/SlicingQuotationTests.fs @@ -1,7 +1,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs b/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs index 1807bd07f5e..3899a42f8b1 100644 --- a/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs +++ b/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities #if NETCOREAPP [] diff --git a/tests/fsharp/Compiler/Language/SpanTests.fs b/tests/fsharp/Compiler/Language/SpanTests.fs index 3aa586d85b0..2eb6b44916b 100644 --- a/tests/fsharp/Compiler/Language/SpanTests.fs +++ b/tests/fsharp/Compiler/Language/SpanTests.fs @@ -5,7 +5,7 @@ namespace FSharp.Compiler.UnitTests open System open FSharp.Compiler.SourceCodeServices open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities #if NETCOREAPP [] diff --git a/tests/fsharp/Compiler/Language/StringConcatOptimizationTests.fs b/tests/fsharp/Compiler/Language/StringConcatOptimizationTests.fs index 7d08368be4f..67fbc78283f 100644 --- a/tests/fsharp/Compiler/Language/StringConcatOptimizationTests.fs +++ b/tests/fsharp/Compiler/Language/StringConcatOptimizationTests.fs @@ -4,7 +4,7 @@ namespace FSharp.Compiler.UnitTests open System open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities #if !NETCOREAPP [] diff --git a/tests/fsharp/Compiler/Language/TypeAttributeTests.fs b/tests/fsharp/Compiler/Language/TypeAttributeTests.fs index c005f981fd8..d93e135daf9 100644 --- a/tests/fsharp/Compiler/Language/TypeAttributeTests.fs +++ b/tests/fsharp/Compiler/Language/TypeAttributeTests.fs @@ -1,7 +1,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/Language/UIntTests.fs b/tests/fsharp/Compiler/Language/UIntTests.fs index e6570bb62be..8d2b6454136 100644 --- a/tests/fsharp/Compiler/Language/UIntTests.fs +++ b/tests/fsharp/Compiler/Language/UIntTests.fs @@ -1,11 +1,11 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities [] module UIntTests = let ``uint type abbreviation works`` () = let src = "let x = uint 12" let expectedErrors = [||] - CompilerAssert.TypeCheckWithErrors src expectedErrors \ No newline at end of file + CompilerAssert.TypeCheckWithErrors src expectedErrors diff --git a/tests/fsharp/Compiler/Libraries/Core/Collections/ListTests.fs b/tests/fsharp/Compiler/Libraries/Core/Collections/ListTests.fs index 5c90706dee5..974bc67b9bd 100644 --- a/tests/fsharp/Compiler/Libraries/Core/Collections/ListTests.fs +++ b/tests/fsharp/Compiler/Libraries/Core/Collections/ListTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] @@ -57,4 +57,4 @@ List.tl [1] |> ignore Assert.areEqual "a" (List.head ["a"]) Assert.areEqual [2 .. 10] (List.tail [1 .. 10]) Assert.areEqual [] (List.tail [1]) - Assert.areEqual (List.head (List.tail ['a'; 'a'])) (List.head ['a'; 'a']) \ No newline at end of file + Assert.areEqual (List.head (List.tail ['a'; 'a'])) (List.head ['a'; 'a']) diff --git a/tests/fsharp/Compiler/Libraries/Core/ExtraTopLevelOperators/DictionaryTests.fs b/tests/fsharp/Compiler/Libraries/Core/ExtraTopLevelOperators/DictionaryTests.fs index d36945b4cd1..c2f00658833 100644 --- a/tests/fsharp/Compiler/Libraries/Core/ExtraTopLevelOperators/DictionaryTests.fs +++ b/tests/fsharp/Compiler/Libraries/Core/ExtraTopLevelOperators/DictionaryTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities module ``Dictionary Tests`` = diff --git a/tests/fsharp/Compiler/Libraries/Core/LanguagePrimitives/CastToUnitsTests.fs b/tests/fsharp/Compiler/Libraries/Core/LanguagePrimitives/CastToUnitsTests.fs index d53f23d6ab0..f5eff5d7be4 100644 --- a/tests/fsharp/Compiler/Libraries/Core/LanguagePrimitives/CastToUnitsTests.fs +++ b/tests/fsharp/Compiler/Libraries/Core/LanguagePrimitives/CastToUnitsTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities [] module ``Cast to Units Tests`` = @@ -26,4 +26,4 @@ let r4 = Int64WithMeasure 5L / 5L let r5 = FloatWithMeasure 11.11 + 1.1 let r6 = Float32WithMeasure 22.22f - 11.11f let r7 = DecimalWithMeasure 33.33M * 44.44M - """ \ No newline at end of file + """ diff --git a/tests/fsharp/Compiler/Regressions/ForInDoMutableRegressionTest.fs b/tests/fsharp/Compiler/Regressions/ForInDoMutableRegressionTest.fs index f7f29224a66..28cc6340422 100644 --- a/tests/fsharp/Compiler/Regressions/ForInDoMutableRegressionTest.fs +++ b/tests/fsharp/Compiler/Regressions/ForInDoMutableRegressionTest.fs @@ -4,7 +4,7 @@ namespace FSharp.Compiler.UnitTests open System open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities [] module ForInDoMutableRegressionTest = diff --git a/tests/fsharp/Compiler/Regressions/IndexerRegressionTests.fs b/tests/fsharp/Compiler/Regressions/IndexerRegressionTests.fs index 7ca54fe1082..a6e7cf6e4e9 100644 --- a/tests/fsharp/Compiler/Regressions/IndexerRegressionTests.fs +++ b/tests/fsharp/Compiler/Regressions/IndexerRegressionTests.fs @@ -4,7 +4,7 @@ namespace FSharp.Compiler.UnitTests open System open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities [] module IndexerRegressionTests = diff --git a/tests/fsharp/Compiler/Stress/LargeExprTests.fs b/tests/fsharp/Compiler/Stress/LargeExprTests.fs index a440c289646..9be3574c000 100644 --- a/tests/fsharp/Compiler/Stress/LargeExprTests.fs +++ b/tests/fsharp/Compiler/Stress/LargeExprTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities [] module LargeExprTests = @@ -5573,4 +5573,4 @@ let test () : unit = test () """ - CompilerAssert.RunScript source [] \ No newline at end of file + CompilerAssert.RunScript source [] diff --git a/tests/fsharp/Compiler/Warnings/AssignmentWarningTests.fs b/tests/fsharp/Compiler/Warnings/AssignmentWarningTests.fs index 29cceedd782..c6fdb75d97f 100644 --- a/tests/fsharp/Compiler/Warnings/AssignmentWarningTests.fs +++ b/tests/fsharp/Compiler/Warnings/AssignmentWarningTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] @@ -96,4 +96,4 @@ let changeProperty() = FSharpErrorSeverity.Warning 20 (9, 5, 9, 23) - "The result of this equality expression has type 'bool' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'." \ No newline at end of file + "The result of this equality expression has type 'bool' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'." diff --git a/tests/fsharp/Compiler/Warnings/ExperimentalAttributeTests.fs b/tests/fsharp/Compiler/Warnings/ExperimentalAttributeTests.fs index 99e4b54c87f..ce31ccb45e2 100644 --- a/tests/fsharp/Compiler/Warnings/ExperimentalAttributeTests.fs +++ b/tests/fsharp/Compiler/Warnings/ExperimentalAttributeTests.fs @@ -2,7 +2,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/Compiler/Warnings/PatternMatchingWarningTests.fs b/tests/fsharp/Compiler/Warnings/PatternMatchingWarningTests.fs index 5f8e161c41a..7c371cfc2f3 100644 --- a/tests/fsharp/Compiler/Warnings/PatternMatchingWarningTests.fs +++ b/tests/fsharp/Compiler/Warnings/PatternMatchingWarningTests.fs @@ -1,7 +1,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 46cab3c2a27..bf896e7a5de 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -93,7 +93,7 @@ - + diff --git a/tests/fsharp/TypeProviderTests.fs b/tests/fsharp/TypeProviderTests.fs index 64680071373..e2975635f44 100644 --- a/tests/fsharp/TypeProviderTests.fs +++ b/tests/fsharp/TypeProviderTests.fs @@ -4,7 +4,7 @@ //#r @"../../release/net40/bin/FSharp.Compiler.dll" #r @"../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "../../src/scripts/scriptlib.fsx" -#load "../FSharp.TestHelpers/TestFramework.fs" +#load "../FSharp.Test.Utilities/TestFramework.fs" #load "single-test.fs" #else [] diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 19e8c725f48..007786ca209 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2,7 +2,7 @@ #if INTERACTIVE #r @"../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "../../src/scripts/scriptlib.fsx" -#load "../FSharp.TestHelpers/TestFramework.fs" +#load "../FSharp.Test.Utilities/TestFramework.fs" #load "single-test.fs" #else module ``FSharp-Tests-Core`` @@ -2990,4 +2990,4 @@ module OverloadResolution = let [] ``neg_known_return_type_and_known_type_arguments`` () = singleNegTest (testConfig' "typecheck/overloads") "neg_known_return_type_and_known_type_arguments" let [] ``neg_generic_known_argument_types`` () = singleNegTest (testConfig' "typecheck/overloads") "neg_generic_known_argument_types" let [] ``neg_tupled_arguments`` () = singleNegTest (testConfig' "typecheck/overloads") "neg_tupled_arguments" -#endif \ No newline at end of file +#endif From 1672d20e020f3ed7fd6841ba0681c955dccba905 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 9 Jun 2020 16:53:42 +0200 Subject: [PATCH 03/15] [WIP] Migrate Compiler.UnitTests to xUnit --- FSharpBuild.Directory.Build.props | 1 + eng/Versions.props | 2 +- tests/Directory.Build.targets | 2 +- .../FSharp.Compiler.UnitTests/EditDistance.fs | 2 +- .../FSharp.Compiler.UnitTests.fsproj | 2 + tests/FSharp.Compiler.UnitTests/FsiTests.fs | 737 +++++++++--------- .../HashIfExpression.fs | 29 +- .../ManglingNameOfProvidedTypes.fs | 22 +- .../FSharp.Compiler.UnitTests/NunitHelpers.fs | 2 +- .../SuggestionBuffer.fs | 16 +- tests/FSharp.Test.Utilities/Assert.fs | 20 + ...rs.fsproj => FSharp.Test.Utilities.fsproj} | 1 + 12 files changed, 425 insertions(+), 411 deletions(-) create mode 100644 tests/FSharp.Test.Utilities/Assert.fs rename tests/FSharp.Test.Utilities/{FSharp.TestHelpers.fsproj => FSharp.Test.Utilities.fsproj} (98%) diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 791850399b3..681a3d3c703 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -10,6 +10,7 @@ $(RepoRoot)src + $(RepoRoot)tests $(ArtifactsDir)\SymStore $(ArtifactsDir)\Bootstrap 4.4.0 diff --git a/eng/Versions.props b/eng/Versions.props index a6fcf9439e4..a9b401f28bd 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -187,6 +187,6 @@ 5.28.0.1 2.0.187 2.4.1 - 2.4.1 + 5.10.3 diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets index 77272699622..6df5fdfa9c7 100644 --- a/tests/Directory.Build.targets +++ b/tests/Directory.Build.targets @@ -9,7 +9,7 @@ - + diff --git a/tests/FSharp.Compiler.UnitTests/EditDistance.fs b/tests/FSharp.Compiler.UnitTests/EditDistance.fs index f6f3ec1f03a..fa56c64d2d4 100644 --- a/tests/FSharp.Compiler.UnitTests/EditDistance.fs +++ b/tests/FSharp.Compiler.UnitTests/EditDistance.fs @@ -22,6 +22,6 @@ module EditDistance = [] [] [] - let EditDistanceTest (str1 : string, str2 : string, expected : string) : unit = + let EditDistanceTest (str1 : string, str2 : string, expected : int) : unit = CalcEditDistance(str1,str2) |> Assert.shouldBe expected diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj index b0001c2e11a..057dc38c692 100644 --- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj +++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj @@ -8,6 +8,7 @@ Library true xunit + $(NoWarn);3186;1104;NETSDK1023 @@ -24,6 +25,7 @@ + diff --git a/tests/FSharp.Compiler.UnitTests/FsiTests.fs b/tests/FSharp.Compiler.UnitTests/FsiTests.fs index 23c1e30dd7a..5edebc0d478 100644 --- a/tests/FSharp.Compiler.UnitTests/FsiTests.fs +++ b/tests/FSharp.Compiler.UnitTests/FsiTests.fs @@ -1,548 +1,547 @@ -[] -module FSharp.Compiler.UnitTests.FsiTests - +namespace FSharp.Compiler.UnitTests open System open System.IO open FSharp.Compiler.Interactive.Shell open Xunit open FSharp.Test.Utilities -#nowarn "1104" +[] +module FsiTests = + + let createFsiSession () = + // Intialize output and input streams + let inStream = new StringReader("") + let outStream = new CompilerOutputStream() + let errStream = new CompilerOutputStream() -let createFsiSession () = - // Intialize output and input streams - let inStream = new StringReader("") - let outStream = new CompilerOutputStream() - let errStream = new CompilerOutputStream() + // Build command line arguments & start FSI session + let argv = [| "C:\\fsi.exe" |] + let allArgs = Array.append argv [|"--noninteractive"|] - // Build command line arguments & start FSI session - let argv = [| "C:\\fsi.exe" |] - let allArgs = Array.append argv [|"--noninteractive"|] + let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration() + FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, new StreamWriter(outStream), new StreamWriter(errStream), collectible = true) - let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration() - FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, new StreamWriter(outStream), new StreamWriter(errStream), collectible = true) + [] + let ``No bound values at the start of FSI session`` () = + use fsiSession = createFsiSession () + let values = fsiSession.GetBoundValues() + Assert.shouldBeEmpty values -[] -let ``No bound values at the start of FSI session`` () = - use fsiSession = createFsiSession () - let values = fsiSession.GetBoundValues() - Assert.IsEmpty values + [] + let ``Bound value has correct name`` () = + use fsiSession = createFsiSession () -[] -let ``Bound value has correct name`` () = - use fsiSession = createFsiSession () + fsiSession.EvalInteraction("let x = 1") - fsiSession.EvalInteraction("let x = 1") + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + Assert.shouldBe "x" boundValue.Name - Assert.shouldBe("x", boundValue.Name) + [] + let ``Bound value has correct value`` () = + use fsiSession = createFsiSession () -[] -let ``Bound value has correct value`` () = - use fsiSession = createFsiSession () + fsiSession.EvalInteraction("let y = 2") - fsiSession.EvalInteraction("let y = 2") + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + Assert.shouldBe 2 boundValue.Value.ReflectionValue - Assert.shouldBe(2, boundValue.Value.ReflectionValue) + [] + let ``Bound value has correct type`` () = + use fsiSession = createFsiSession () -[] -let ``Bound value has correct type`` () = - use fsiSession = createFsiSession () + fsiSession.EvalInteraction("let z = 3") - fsiSession.EvalInteraction("let z = 3") + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + Assert.shouldBe typeof boundValue.Value.ReflectionType - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + [] + let ``Seven bound values are ordered and have their correct name`` () = + use fsiSession = createFsiSession () -[] -let ``Seven bound values are ordered and have their correct name`` () = - use fsiSession = createFsiSession () + fsiSession.EvalInteraction("let x = 1") + fsiSession.EvalInteraction("let y = 2") + fsiSession.EvalInteraction("let z = 3") + fsiSession.EvalInteraction("let a = 4") + fsiSession.EvalInteraction("let ccc = 5") + fsiSession.EvalInteraction("let b = 6") + fsiSession.EvalInteraction("let aa = 7") - fsiSession.EvalInteraction("let x = 1") - fsiSession.EvalInteraction("let y = 2") - fsiSession.EvalInteraction("let z = 3") - fsiSession.EvalInteraction("let a = 4") - fsiSession.EvalInteraction("let ccc = 5") - fsiSession.EvalInteraction("let b = 6") - fsiSession.EvalInteraction("let aa = 7") + let names = fsiSession.GetBoundValues() |> List.map (fun x -> x.Name) - let names = fsiSession.GetBoundValues() |> List.map (fun x -> x.Name) + Assert.shouldBe ["a";"aa";"b";"ccc";"x";"y";"z"] names - Assert.shouldBe(["a";"aa";"b";"ccc";"x";"y";"z"], names) + [] + let ``Seven bound values are ordered and have their correct value`` () = + use fsiSession = createFsiSession () -[] -let ``Seven bound values are ordered and have their correct value`` () = - use fsiSession = createFsiSession () + fsiSession.EvalInteraction("let x = 1") + fsiSession.EvalInteraction("let y = 2") + fsiSession.EvalInteraction("let z = 3") + fsiSession.EvalInteraction("let a = 4") + fsiSession.EvalInteraction("let ccc = 5") + fsiSession.EvalInteraction("let b = 6") + fsiSession.EvalInteraction("let aa = 7") - fsiSession.EvalInteraction("let x = 1") - fsiSession.EvalInteraction("let y = 2") - fsiSession.EvalInteraction("let z = 3") - fsiSession.EvalInteraction("let a = 4") - fsiSession.EvalInteraction("let ccc = 5") - fsiSession.EvalInteraction("let b = 6") - fsiSession.EvalInteraction("let aa = 7") + let values = fsiSession.GetBoundValues() |> List.map (fun x -> x.Value.ReflectionValue) - let values = fsiSession.GetBoundValues() |> List.map (fun x -> x.Value.ReflectionValue) + Assert.shouldBe [4;7;6;5;1;2;3] values - Assert.shouldBe([4;7;6;5;1;2;3], values) + [] + let ``Seven bound values are ordered and have their correct type`` () = + use fsiSession = createFsiSession () -[] -let ``Seven bound values are ordered and have their correct type`` () = - use fsiSession = createFsiSession () + fsiSession.EvalInteraction("let x = 1") + fsiSession.EvalInteraction("let y = 2") + fsiSession.EvalInteraction("let z = 3") + fsiSession.EvalInteraction("let a = 4.") + fsiSession.EvalInteraction("let ccc = 5") + fsiSession.EvalInteraction("let b = 6.f") + fsiSession.EvalInteraction("let aa = 7") - fsiSession.EvalInteraction("let x = 1") - fsiSession.EvalInteraction("let y = 2") - fsiSession.EvalInteraction("let z = 3") - fsiSession.EvalInteraction("let a = 4.") - fsiSession.EvalInteraction("let ccc = 5") - fsiSession.EvalInteraction("let b = 6.f") - fsiSession.EvalInteraction("let aa = 7") + let types = fsiSession.GetBoundValues() |> List.map (fun x -> x.Value.ReflectionType) - let types = fsiSession.GetBoundValues() |> List.map (fun x -> x.Value.ReflectionType) + Assert.shouldBe [typeof;typeof;typeof;typeof;typeof;typeof;typeof] types - Assert.shouldBe([typeof;typeof;typeof;typeof;typeof;typeof;typeof], types) + [] + let ``Able to find a bound value by the identifier`` () = + use fsiSession = createFsiSession () -[] -let ``Able to find a bound value by the identifier`` () = - use fsiSession = createFsiSession () + fsiSession.EvalInteraction("let x = 1") + fsiSession.EvalInteraction("let y = 2") + fsiSession.EvalInteraction("let z = 3") + fsiSession.EvalInteraction("let a = 4") + fsiSession.EvalInteraction("let ccc = 5") + fsiSession.EvalInteraction("let b = 6") + fsiSession.EvalInteraction("let aa = 7") - fsiSession.EvalInteraction("let x = 1") - fsiSession.EvalInteraction("let y = 2") - fsiSession.EvalInteraction("let z = 3") - fsiSession.EvalInteraction("let a = 4") - fsiSession.EvalInteraction("let ccc = 5") - fsiSession.EvalInteraction("let b = 6") - fsiSession.EvalInteraction("let aa = 7") + let boundValueOpt = fsiSession.TryFindBoundValue "ccc" - let boundValueOpt = fsiSession.TryFindBoundValue "ccc" + Assert.shouldBeTrue boundValueOpt.IsSome - Assert.IsTrue boundValueOpt.IsSome + [] + let ``Able to find a bound value by the identifier and has valid info`` () = + use fsiSession = createFsiSession () -[] -let ``Able to find a bound value by the identifier and has valid info`` () = - use fsiSession = createFsiSession () + fsiSession.EvalInteraction("let x = 1.") + fsiSession.EvalInteraction("let y = 2.") + fsiSession.EvalInteraction("let z = 3") + fsiSession.EvalInteraction("let a = 4.") + fsiSession.EvalInteraction("let ccc = 5.") + fsiSession.EvalInteraction("let b = 6.") + fsiSession.EvalInteraction("let aa = 7.") - fsiSession.EvalInteraction("let x = 1.") - fsiSession.EvalInteraction("let y = 2.") - fsiSession.EvalInteraction("let z = 3") - fsiSession.EvalInteraction("let a = 4.") - fsiSession.EvalInteraction("let ccc = 5.") - fsiSession.EvalInteraction("let b = 6.") - fsiSession.EvalInteraction("let aa = 7.") + let boundValue = (fsiSession.TryFindBoundValue "z").Value - let boundValue = (fsiSession.TryFindBoundValue "z").Value - - Assert.shouldBe("z", boundValue.Name) - Assert.shouldBe(3, boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "z" boundValue.Name + Assert.shouldBe 3 boundValue.Value.ReflectionValue + Assert.shouldBe typeof boundValue.Value.ReflectionType -[] -let ``Not Able to find a bound value by the identifier`` () = - use fsiSession = createFsiSession () + [] + let ``Not Able to find a bound value by the identifier`` () = + use fsiSession = createFsiSession () - fsiSession.EvalInteraction("let x = 1") - fsiSession.EvalInteraction("let y = 2") - fsiSession.EvalInteraction("let z = 3") - fsiSession.EvalInteraction("let a = 4") - fsiSession.EvalInteraction("let ccc = 5") - fsiSession.EvalInteraction("let b = 6") - fsiSession.EvalInteraction("let aa = 7") + fsiSession.EvalInteraction("let x = 1") + fsiSession.EvalInteraction("let y = 2") + fsiSession.EvalInteraction("let z = 3") + fsiSession.EvalInteraction("let a = 4") + fsiSession.EvalInteraction("let ccc = 5") + fsiSession.EvalInteraction("let b = 6") + fsiSession.EvalInteraction("let aa = 7") - let boundValueOpt = fsiSession.TryFindBoundValue "aaa" + let boundValueOpt = fsiSession.TryFindBoundValue "aaa" - Assert.IsTrue boundValueOpt.IsNone + Assert.shouldBeTrue boundValueOpt.IsNone -[] -let ``The 'it' value does not exist at the start of a FSI session`` () = - use fsiSession = createFsiSession () + [] + let ``The 'it' value does not exist at the start of a FSI session`` () = + use fsiSession = createFsiSession () - let boundValueOpt = fsiSession.TryFindBoundValue "it" + let boundValueOpt = fsiSession.TryFindBoundValue "it" - Assert.IsTrue boundValueOpt.IsNone + Assert.shouldBeTrue boundValueOpt.IsNone -[] -let ``The 'it' bound value does exists after a value is not explicitly bound`` () = - use fsiSession = createFsiSession () + [] + let ``The 'it' bound value does exists after a value is not explicitly bound`` () = + use fsiSession = createFsiSession () - fsiSession.EvalInteraction("456") + fsiSession.EvalInteraction("456") - let boundValueOpt = fsiSession.TryFindBoundValue "it" + let boundValueOpt = fsiSession.TryFindBoundValue "it" - Assert.IsTrue boundValueOpt.IsSome + Assert.shouldBeTrue boundValueOpt.IsSome -[] -let ``The 'it' value does exists after a value is not explicitly bound and has valid info`` () = - use fsiSession = createFsiSession () + [] + let ``The 'it' value does exists after a value is not explicitly bound and has valid info`` () = + use fsiSession = createFsiSession () - fsiSession.EvalInteraction("456") + fsiSession.EvalInteraction("456") - let boundValue = (fsiSession.TryFindBoundValue "it").Value + let boundValue = (fsiSession.TryFindBoundValue "it").Value - Assert.shouldBe("it", boundValue.Name) - Assert.shouldBe(456, boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "it" boundValue.Name + Assert.shouldBe 456 boundValue.Value.ReflectionValue + Assert.shouldBe typeof boundValue.Value.ReflectionType -[] -let ``The latest shadowed value is only available`` () = - use fsiSession = createFsiSession () + [] + let ``The latest shadowed value is only available`` () = + use fsiSession = createFsiSession () - fsiSession.EvalInteraction("let x = 1") - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + fsiSession.EvalInteraction("let x = 1") + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe("x", boundValue.Name) - Assert.shouldBe(1, boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "x" boundValue.Name + Assert.shouldBe 1 boundValue.Value.ReflectionValue + Assert.shouldBe typeof boundValue.Value.ReflectionType - fsiSession.EvalInteraction("let x = (1, 2)") - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + fsiSession.EvalInteraction("let x = (1, 2)") + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe("x", boundValue.Name) - Assert.shouldBe((1, 2), boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "x" boundValue.Name + Assert.shouldBe (1, 2) boundValue.Value.ReflectionValue + Assert.shouldBe typeof boundValue.Value.ReflectionType -[] -let ``The latest shadowed value is only available and can be found`` () = - use fsiSession = createFsiSession () + [] + let ``The latest shadowed value is only available and can be found`` () = + use fsiSession = createFsiSession () - fsiSession.EvalInteraction("let x = 1") - let boundValue = (fsiSession.TryFindBoundValue "x").Value + fsiSession.EvalInteraction("let x = 1") + let boundValue = (fsiSession.TryFindBoundValue "x").Value - Assert.shouldBe("x", boundValue.Name) - Assert.shouldBe(1, boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "x" boundValue.Name + Assert.shouldBe 1 boundValue.Value.ReflectionValue + Assert.shouldBe typeof boundValue.Value.ReflectionType - fsiSession.EvalInteraction("let x = (1, 2)") - let boundValue = (fsiSession.TryFindBoundValue "x").Value + fsiSession.EvalInteraction("let x = (1, 2)") + let boundValue = (fsiSession.TryFindBoundValue "x").Value - Assert.shouldBe("x", boundValue.Name) - Assert.shouldBe((1, 2), boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "x" boundValue.Name + Assert.shouldBe (1, 2) boundValue.Value.ReflectionValue + Assert.shouldBe typeof boundValue.Value.ReflectionType -[] -let ``Values are successfully shadowed even with intermediate interactions`` () = - use fsiSession = createFsiSession () + [] + let ``Values are successfully shadowed even with intermediate interactions`` () = + use fsiSession = createFsiSession () - fsiSession.EvalInteraction("let x = 1") - fsiSession.EvalInteraction("let z = 100") - fsiSession.EvalInteraction("let x = (1, 2)") - fsiSession.EvalInteraction("let w = obj ()") + fsiSession.EvalInteraction("let x = 1") + fsiSession.EvalInteraction("let z = 100") + fsiSession.EvalInteraction("let x = (1, 2)") + fsiSession.EvalInteraction("let w = obj ()") - let boundValues = fsiSession.GetBoundValues() + let boundValues = fsiSession.GetBoundValues() - Assert.shouldBe(3, boundValues.Length) + Assert.shouldBe 3 boundValues.Length - let boundValue = boundValues |> List.find (fun x -> x.Name = "x") + let boundValue = boundValues |> List.find (fun x -> x.Name = "x") - Assert.shouldBe("x", boundValue.Name) - Assert.shouldBe((1, 2), boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "x" boundValue.Name + Assert.shouldBe (1, 2) boundValue.Value.ReflectionValue + Assert.shouldBe typeof boundValue.Value.ReflectionType - let boundValue = (fsiSession.TryFindBoundValue "x").Value + let boundValue = (fsiSession.TryFindBoundValue "x").Value - Assert.shouldBe("x", boundValue.Name) - Assert.shouldBe((1, 2), boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "x" boundValue.Name + Assert.shouldBe (1, 2) boundValue.Value.ReflectionValue + Assert.shouldBe typeof boundValue.Value.ReflectionType -[] -let ``Creation of a simple bound value succeeds`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a simple bound value succeeds`` () = + use fsiSession = createFsiSession () - fsiSession.AddBoundValue("x", 1) + fsiSession.AddBoundValue("x", 1) - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe("x", boundValue.Name) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) - Assert.shouldBe(1, boundValue.Value.ReflectionValue) + Assert.shouldBe "x" boundValue.Name + Assert.shouldBe typeof boundValue.Value.ReflectionType + Assert.shouldBe 1 boundValue.Value.ReflectionValue -[] -let ``Creation of a bound value succeeds with underscores in the identifier`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value succeeds with underscores in the identifier`` () = + use fsiSession = createFsiSession () - fsiSession.AddBoundValue("x_y_z", 1) + fsiSession.AddBoundValue("x_y_z", 1) - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe("x_y_z", boundValue.Name) + Assert.shouldBe "x_y_z" boundValue.Name -[] -let ``Creation of a bound value succeeds with tildes in the identifier`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value succeeds with tildes in the identifier`` () = + use fsiSession = createFsiSession () - fsiSession.AddBoundValue("``hello world``", 1) + fsiSession.AddBoundValue("``hello world``", 1) - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe("``hello world``", boundValue.Name) + Assert.shouldBe "``hello world``" boundValue.Name -[] -let ``Creation of a bound value succeeds with 'it' as the indentifier`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value succeeds with 'it' as the indentifier`` () = + use fsiSession = createFsiSession () - fsiSession.EvalInteraction("\"test\"") + fsiSession.EvalInteraction("\"test\"") - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe("it", boundValue.Name) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "it" boundValue.Name + Assert.shouldBe typeof boundValue.Value.ReflectionType - fsiSession.AddBoundValue("it", 1) + fsiSession.AddBoundValue("it", 1) - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe("it", boundValue.Name) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "it" boundValue.Name + Assert.shouldBe typeof boundValue.Value.ReflectionType -[] -let ``Creation of a bound value fails with tildes in the identifier and with 'at' but has warning`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails with tildes in the identifier and with 'at' but has warning`` () = + use fsiSession = createFsiSession () - Assert.Throws(fun () -> fsiSession.AddBoundValue("``hello @ world``", 1)) |> ignore + Assert.Throws(fun () -> fsiSession.AddBoundValue("``hello @ world``", 1)) |> ignore -[] -let ``Creation of a bound value fails if the name is not a valid identifier with 'at' in front`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails if the name is not a valid identifier with 'at' in front`` () = + use fsiSession = createFsiSession () - Assert.Throws(fun () -> fsiSession.AddBoundValue("@x", 1)) |> ignore + Assert.Throws(fun () -> fsiSession.AddBoundValue("@x", 1)) |> ignore -[] -let ``Creation of a bound value fails if the name is not a valid identifier with 'at' in back`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails if the name is not a valid identifier with 'at' in back`` () = + use fsiSession = createFsiSession () - Assert.Throws(fun () -> fsiSession.AddBoundValue("x@", 1)) |> ignore + Assert.Throws(fun () -> fsiSession.AddBoundValue("x@", 1)) |> ignore -[] -let ``Creation of a bound value fails if the name is null`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails if the name is null`` () = + use fsiSession = createFsiSession () - Assert.Throws(fun () -> fsiSession.AddBoundValue(null, 1)) |> ignore + Assert.Throws(fun () -> fsiSession.AddBoundValue(null, 1)) |> ignore -[] -let ``Creation of a bound value fails if the name is empty`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails if the name is empty`` () = + use fsiSession = createFsiSession () - Assert.Throws(fun () -> fsiSession.AddBoundValue("", 1)) |> ignore + Assert.Throws(fun () -> fsiSession.AddBoundValue("", 1)) |> ignore -[] -let ``Creation of a bound value fails if the name is whitespace`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails if the name is whitespace`` () = + use fsiSession = createFsiSession () - Assert.Throws(fun () -> fsiSession.AddBoundValue(" ", 1)) |> ignore + Assert.Throws(fun () -> fsiSession.AddBoundValue(" ", 1)) |> ignore -[] -let ``Creation of a bound value fails if the name contains spaces`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails if the name contains spaces`` () = + use fsiSession = createFsiSession () - Assert.Throws(fun () -> fsiSession.AddBoundValue("x x", 1)) |> ignore + Assert.Throws(fun () -> fsiSession.AddBoundValue("x x", 1)) |> ignore -[] -let ``Creation of a bound value fails if the name contains an operator at the end`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails if the name contains an operator at the end`` () = + use fsiSession = createFsiSession () - Assert.Throws(fun () -> fsiSession.AddBoundValue("x+", 1)) |> ignore + Assert.Throws(fun () -> fsiSession.AddBoundValue("x+", 1)) |> ignore -[] -let ``Creation of a bound value fails if the name contains an operator at the front`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails if the name contains an operator at the front`` () = + use fsiSession = createFsiSession () - Assert.Throws(fun () -> fsiSession.AddBoundValue("+x", 1)) |> ignore + Assert.Throws(fun () -> fsiSession.AddBoundValue("+x", 1)) |> ignore -[] -let ``Creation of a bound value fails if the name contains dots`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails if the name contains dots`` () = + use fsiSession = createFsiSession () - Assert.Throws(fun () -> fsiSession.AddBoundValue("x.x", 1)) |> ignore + Assert.Throws(fun () -> fsiSession.AddBoundValue("x.x", 1)) |> ignore -[] -let ``Creation of a bound value fails if the value passed is null`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails if the value passed is null`` () = + use fsiSession = createFsiSession () - Assert.Throws(fun () -> fsiSession.AddBoundValue("x", null) |> ignore) |> ignore + Assert.Throws(fun () -> fsiSession.AddBoundValue("x", null) |> ignore) |> ignore -type CustomType = { X: int } + type CustomType = { X: int } -[] -let ``Creation of a bound value succeeds if the value contains types from assemblies that are not referenced in the session, due to implicit resolution`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value succeeds if the value contains types from assemblies that are not referenced in the session, due to implicit resolution`` () = + use fsiSession = createFsiSession () - fsiSession.AddBoundValue("x", { X = 1 }) + fsiSession.AddBoundValue("x", { X = 1 }) -[] -let ``Creation of a bound value succeeds if the value contains types from assemblies that are not referenced in the session, due to implicit resolution, and then doing some evaluation`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value succeeds if the value contains types from assemblies that are not referenced in the session, due to implicit resolution, and then doing some evaluation`` () = + use fsiSession = createFsiSession () - fsiSession.AddBoundValue("x", { X = 1 }) - fsiSession.EvalInteraction("let y = { x with X = 5 }") + fsiSession.AddBoundValue("x", { X = 1 }) + fsiSession.EvalInteraction("let y = { x with X = 5 }") - let boundValues = fsiSession.GetBoundValues() - Assert.shouldBe(2, boundValues.Length) + let boundValues = fsiSession.GetBoundValues() + Assert.shouldBe 2 boundValues.Length - let v1 = boundValues.[0] - let v2 = boundValues.[1] + let v1 = boundValues.[0] + let v2 = boundValues.[1] - Assert.shouldBe("x", v1.Name) - Assert.shouldBe({ X = 1 }, v1.Value.ReflectionValue) - Assert.shouldBe(typeof, v1.Value.ReflectionType) + Assert.shouldBe "x" v1.Name + Assert.shouldBe { X = 1 } v1.Value.ReflectionValue + Assert.shouldBe typeof v1.Value.ReflectionType - Assert.shouldBe("y", v2.Name) - Assert.shouldBe({ X = 5 }, v2.Value.ReflectionValue) - Assert.shouldBe(typeof, v2.Value.ReflectionType) + Assert.shouldBe "y" v2.Name + Assert.shouldBe { X = 5 } v2.Value.ReflectionValue + Assert.shouldBe typeof v2.Value.ReflectionType -[] -let ``Creation of a bound value, of type ResizeArray, succeeds`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value, of type ResizeArray, succeeds`` () = + use fsiSession = createFsiSession () - let xs = ResizeArray() - xs.Add("banana") - xs.Add("apple") + let xs = ResizeArray() + xs.Add("banana") + xs.Add("apple") - fsiSession.AddBoundValue("xs", xs) + fsiSession.AddBoundValue("xs", xs) - let boundValues = fsiSession.GetBoundValues() - Assert.shouldBe(1, boundValues.Length) + let boundValues = fsiSession.GetBoundValues() + Assert.shouldBe 1 boundValues.Length - let v1 = boundValues.[0] + let v1 = boundValues.[0] - Assert.shouldBe("xs", v1.Name) - Assert.shouldBe(xs, v1.Value.ReflectionValue) - Assert.shouldBe(typeof>, v1.Value.ReflectionType) + Assert.shouldBe "xs" v1.Name + Assert.shouldBe xs v1.Value.ReflectionValue + Assert.shouldBe typeof> v1.Value.ReflectionType -type CustomType2() = + type CustomType2() = - member _.Message = "hello" + member _.Message = "hello" -[] -let ``Creation of a bound value succeeds if the value contains types from assemblies that are not referenced in the session, due to implicit resolution, and then use a member from it`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value succeeds if the value contains types from assemblies that are not referenced in the session, due to implicit resolution, and then use a member from it`` () = + use fsiSession = createFsiSession () - let value = CustomType2() - fsiSession.AddBoundValue("x", value) + let value = CustomType2() + fsiSession.AddBoundValue("x", value) - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe("x", boundValue.Name) - Assert.shouldBe(value, boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "x" boundValue.Name + Assert.shouldBe value boundValue.Value.ReflectionValue + Assert.shouldBe typeof boundValue.Value.ReflectionType - fsiSession.EvalInteraction("let x = x.Message") + fsiSession.EvalInteraction("let x = x.Message") - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe("x", boundValue.Name) - Assert.shouldBe("hello", boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "x" boundValue.Name + Assert.shouldBe "hello" boundValue.Value.ReflectionValue + Assert.shouldBe typeof boundValue.Value.ReflectionType -[] -let ``Creation of a bound value succeeds if the value contains generic types from assemblies that are not referenced in the session, due to implicit resolution, and then use a member from it`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value succeeds if the value contains generic types from assemblies that are not referenced in the session, due to implicit resolution, and then use a member from it`` () = + use fsiSession = createFsiSession () - let value = ResizeArray() - value.Add(CustomType2()) + let value = ResizeArray() + value.Add(CustomType2()) - fsiSession.AddBoundValue("x", value) + fsiSession.AddBoundValue("x", value) - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe("x", boundValue.Name) - Assert.shouldBe(value, boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof>, boundValue.Value.ReflectionType) + Assert.shouldBe "x" boundValue.Name + Assert.shouldBe value boundValue.Value.ReflectionValue + Assert.shouldBe typeof> boundValue.Value.ReflectionType - fsiSession.EvalInteraction("let x = x.[0].Message") + fsiSession.EvalInteraction("let x = x.[0].Message") - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe("x", boundValue.Name) - Assert.shouldBe("hello", boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "x" boundValue.Name + Assert.shouldBe "hello" boundValue.Value.ReflectionValue + Assert.shouldBe typeof boundValue.Value.ReflectionType -[] -let ``Creation of a bound value succeeds if the value contains two generic types from assemblies that are not referenced in the session, due to implicit resolution`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value succeeds if the value contains two generic types from assemblies that are not referenced in the session, due to implicit resolution`` () = + use fsiSession = createFsiSession () - let value = ({ X = 1 }, CustomType2()) + let value = ({ X = 1 }, CustomType2()) - fsiSession.AddBoundValue("x", value) + fsiSession.AddBoundValue("x", value) - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe("x", boundValue.Name) - Assert.shouldBe(value, boundValue.Value.ReflectionValue) - Assert.shouldBe(typeof, boundValue.Value.ReflectionType) + Assert.shouldBe "x" boundValue.Name + Assert.shouldBe value boundValue.Value.ReflectionValue + Assert.shouldBe typeof boundValue.Value.ReflectionType -[] -let ``Creation of a bound value fails if the value contains types from a dynamic assembly`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails if the value contains types from a dynamic assembly`` () = + use fsiSession = createFsiSession () - fsiSession.AddBoundValue("fsiSession", fsiSession) + fsiSession.AddBoundValue("fsiSession", fsiSession) - let res, _ = fsiSession.EvalInteractionNonThrowing(""" -type TypeInDynamicAssembly() = class end -fsiSession.AddBoundValue("x", TypeInDynamicAssembly())""") + let res, _ = fsiSession.EvalInteractionNonThrowing(""" + type TypeInDynamicAssembly() = class end + fsiSession.AddBoundValue("x", TypeInDynamicAssembly())""") - match res with - | Choice2Of2 ex -> Assert.shouldBe(typeof, ex.GetType()) - | _ -> failwith "Expected an exception" + match res with + | Choice2Of2 ex -> Assert.shouldBe typeof (ex.GetType()) + | _ -> failwith "Expected an exception" -type internal NonPublicCustomType() = class end + type internal NonPublicCustomType() = class end -[] -let ``Creation of a bound value fails if the value's type is not public`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value fails if the value's type is not public`` () = + use fsiSession = createFsiSession () - Assert.Throws(fun () -> fsiSession.AddBoundValue("x", NonPublicCustomType())) |> ignore + Assert.Throws(fun () -> fsiSession.AddBoundValue("x", NonPublicCustomType())) |> ignore -[] -let ``Creation of a bound value succeeds if the value is a partial application function type`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value succeeds if the value is a partial application function type`` () = + use fsiSession = createFsiSession () - fsiSession.AddBoundValue("createFsiSession", createFsiSession) + fsiSession.AddBoundValue("createFsiSession", createFsiSession) - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe(typeof FsiEvaluationSession>, boundValue.Value.ReflectionType) + Assert.shouldBe typeof FsiEvaluationSession> boundValue.Value.ReflectionType -[] -let ``Creation of a bound value succeeds if the value is a partial application function type with four arguments`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value succeeds if the value is a partial application function type with four arguments`` () = + use fsiSession = createFsiSession () - let addXYZW x y z w = x + y + z + w - let addYZW = addXYZW 1 - let addZW = addYZW 2 + let addXYZW x y z w = x + y + z + w + let addYZW = addXYZW 1 + let addZW = addYZW 2 - fsiSession.AddBoundValue("addZW", addZW) + fsiSession.AddBoundValue("addZW", addZW) - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe(typeof int -> int>, boundValue.Value.ReflectionType) + Assert.shouldBe typeof int -> int> boundValue.Value.ReflectionType -[] -let ``Creation of a bound value succeeds if the value is a lambda`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value succeeds if the value is a lambda`` () = + use fsiSession = createFsiSession () - fsiSession.AddBoundValue("addXYZ", fun x y z -> x + y + z) + fsiSession.AddBoundValue("addXYZ", fun x y z -> x + y + z) - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe(typeof int -> int -> int>, boundValue.Value.ReflectionType) + Assert.shouldBe typeof int -> int -> int> boundValue.Value.ReflectionType -type TestFSharpFunc() = - inherit FSharpFunc() + type TestFSharpFunc() = + inherit FSharpFunc() - override _.Invoke x = x + override _.Invoke x = x -type ``Test2FSharp @ Func``() = - inherit TestFSharpFunc() + type ``Test2FSharp @ Func``() = + inherit TestFSharpFunc() -[] -let ``Creation of a bound value succeeds if the value is a type that inherits FSharpFunc`` () = - use fsiSession = createFsiSession () + [] + let ``Creation of a bound value succeeds if the value is a type that inherits FSharpFunc`` () = + use fsiSession = createFsiSession () - fsiSession.AddBoundValue("test", ``Test2FSharp @ Func``()) + fsiSession.AddBoundValue("test", ``Test2FSharp @ Func``()) - let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne + let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne - Assert.shouldBe(typeof<``Test2FSharp @ Func``>, boundValue.Value.ReflectionType) + Assert.shouldBe typeof<``Test2FSharp @ Func``> boundValue.Value.ReflectionType diff --git a/tests/FSharp.Compiler.UnitTests/HashIfExpression.fs b/tests/FSharp.Compiler.UnitTests/HashIfExpression.fs index b0cb9876c34..6481801adb3 100644 --- a/tests/FSharp.Compiler.UnitTests/HashIfExpression.fs +++ b/tests/FSharp.Compiler.UnitTests/HashIfExpression.fs @@ -19,8 +19,7 @@ open FSharp.Compiler.Features open FSharp.Compiler.ParseHelpers open FSharp.Compiler.SyntaxTree -type HashIfExpression() = - +type public HashIfExpression() = let preludes = [|"#if "; "#elif "|] let epilogues = [|""; " // Testing"|] @@ -34,7 +33,6 @@ type HashIfExpression() = let (&&&) l r = IfdefAnd(l,r) let (|||) l r = IfdefOr(l,r) - let mutable tearDown = fun () -> () let exprAsString (e : LexerIfdefExpression) : string = let sb = StringBuilder() @@ -57,7 +55,7 @@ type HashIfExpression() = let errorLogger = { new ErrorLogger("TestErrorLogger") with - member x.DiagnosticSink(e, isError) = if isError then errors.Add e else warnings.Add e + member x.DiagnosticSink(e, isError) = if isError then errors.Add e else warnings.Add e member x.ErrorCount = errors.Count } @@ -80,19 +78,12 @@ type HashIfExpression() = errors, warnings, parser - [] - member this.Setup() = - let el = CompileThreadStatic.ErrorLogger - tearDown <- - fun () -> - CompileThreadStatic.BuildPhase <- BuildPhase.DefaultPhase - CompileThreadStatic.ErrorLogger <- el - + do // Setup CompileThreadStatic.BuildPhase <- BuildPhase.Compile - - [] - member this.TearDown() = - tearDown () + interface IDisposable with // Teardown + member _.Dispose() = + CompileThreadStatic.BuildPhase <- BuildPhase.DefaultPhase + CompileThreadStatic.ErrorLogger <- CompileThreadStatic.ErrorLogger [] member this.PositiveParserTestCases()= @@ -151,7 +142,7 @@ type HashIfExpression() = let failure = String.Join ("\n", fs) - Assert.shouldBe("", failure) + Assert.shouldBe "" failure () @@ -214,7 +205,7 @@ type HashIfExpression() = let fails = String.Join ("\n", fs) - Assert.shouldBe("", fails) + Assert.shouldBe "" fails [] member this.LexerIfdefEvalTestCases()= @@ -267,4 +258,4 @@ type HashIfExpression() = let fails = String.Join ("\n", fs) - Assert.shouldBe("", fails) + Assert.shouldBe "" fails diff --git a/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs b/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs index c94ffa48465..59eb909e7df 100644 --- a/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs +++ b/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs @@ -14,31 +14,31 @@ type ManglingNamesOfProvidedTypesWithSingleParameter() = member this.MangleWithNonDefaultValue() = let mangled = PrettyNaming.computeMangledNameWithoutDefaultArgValues("MyNamespace.Test", [| "xyz" |], [| "Foo", Some "abc" |]) - Assert.shouldBe("MyNamespace.Test,Foo=\"xyz\"", mangled) + Assert.shouldBe "MyNamespace.Test,Foo=\"xyz\"" mangled [] member this.MangleWithDefaultValue() = let mangled = PrettyNaming.computeMangledNameWithoutDefaultArgValues("MyNamespace.Test", [| "xyz" |], [| "Foo", Some "xyz" |]) - Assert.shouldBe("MyNamespace.Test", mangled) + Assert.shouldBe "MyNamespace.Test" mangled [] member this.DemangleNonDefaultValue() = let name, parameters = PrettyNaming.demangleProvidedTypeName "MyNamespace.Test,Foo=\"xyz\"" - Assert.shouldBe("MyNamespace.Test", name) - Assert.shouldBe([| "Foo", "xyz" |], parameters) + Assert.shouldBe "MyNamespace.Test" name + Assert.shouldBe [| "Foo", "xyz" |] parameters [] member this.DemangleDefaultValue() = let name, parameters = PrettyNaming.demangleProvidedTypeName "MyNamespace.Test," - Assert.shouldBe("MyNamespace.Test", name) - Assert.shouldBe([||], parameters) + Assert.shouldBe "MyNamespace.Test" name + Assert.shouldBe [||] parameters [] member this.DemangleNewDefaultValue() = let name, parameters = PrettyNaming.demangleProvidedTypeName "MyNamespace.Test" - Assert.shouldBe("MyNamespace.Test", name) - Assert.shouldBe([||], parameters) + Assert.shouldBe "MyNamespace.Test" name + Assert.shouldBe [||] parameters type ManglingNamesOfProvidedTypesWithMultipleParameter() = @@ -50,7 +50,7 @@ type ManglingNamesOfProvidedTypesWithMultipleParameter() = ("MyNamespace.Test", [| "xyz"; "abc" |], [| "Foo", Some "foo" "Foo2", Some "foo2" |]) - Assert.shouldBe("MyNamespace.Test,Foo=\"xyz\",Foo2=\"abc\"", mangled) + Assert.shouldBe "MyNamespace.Test,Foo=\"xyz\",Foo2=\"abc\"" mangled [] member this.MangleWithDefaultValue() = @@ -59,11 +59,11 @@ type ManglingNamesOfProvidedTypesWithMultipleParameter() = ("MyNamespace.Test", [| "xyz"; "abc" |], [| "Foo", Some "xyz" "Foo2", Some "abc" |]) - Assert.shouldBe("MyNamespace.Test", mangled) + Assert.shouldBe "MyNamespace.Test" mangled [] member this.DemangleMultiParameter() = let name, parameters = PrettyNaming.demangleProvidedTypeName "TestType,Foo=\"xyz\",Foo2=\"abc\"" - Assert.shouldBe("TestType", name) + Assert.shouldBe "TestType" name Assert.shouldBe([| "Foo", "xyz" "Foo2", "abc" |], parameters) \ No newline at end of file diff --git a/tests/FSharp.Compiler.UnitTests/NunitHelpers.fs b/tests/FSharp.Compiler.UnitTests/NunitHelpers.fs index 37070f87b03..fb944f5af71 100644 --- a/tests/FSharp.Compiler.UnitTests/NunitHelpers.fs +++ b/tests/FSharp.Compiler.UnitTests/NunitHelpers.fs @@ -7,7 +7,7 @@ module Assert = let inline failf fmt = Printf.kprintf fail fmt let inline areEqual (expected: ^T) (actual: ^T) = - Assert.shouldBe(expected, actual) + Assert.shouldBe expected actual module StringAssert = diff --git a/tests/FSharp.Compiler.UnitTests/SuggestionBuffer.fs b/tests/FSharp.Compiler.UnitTests/SuggestionBuffer.fs index ef2da5ca0f9..00a40a93f83 100644 --- a/tests/FSharp.Compiler.UnitTests/SuggestionBuffer.fs +++ b/tests/FSharp.Compiler.UnitTests/SuggestionBuffer.fs @@ -12,8 +12,8 @@ module SuggestionBuffer = let NewBufferShouldBeEmpty() = let buffer = SuggestionBuffer("abdef") - Assert.IsFalse buffer.Disabled - Assert.IsEmpty buffer + Assert.shouldBeFalse buffer.Disabled + Assert.shouldBeEmpty buffer [] let BufferShouldOnlyAcceptSimilarElements() = @@ -29,7 +29,7 @@ module SuggestionBuffer = let SmallIdentifierShouldBeIgnored() = let buffer = SuggestionBuffer("ab") - Assert.IsTrue buffer.Disabled + Assert.shouldBeTrue buffer.Disabled buffer.Add("abce") buffer.Add("somethingcompletelyunrelated") @@ -41,7 +41,7 @@ module SuggestionBuffer = let results = Array.ofSeq buffer - Assert.IsTrue buffer.Disabled + Assert.shouldBeTrue buffer.Disabled Assert.shouldBe [||] results [] @@ -82,14 +82,14 @@ module SuggestionBuffer = buffer.Add("abcg") buffer.Add("abch") - Assert.IsFalse buffer.Disabled - Assert.IsNotEmpty buffer + Assert.shouldBeFalse buffer.Disabled + Assert.shouldNotBeEmpty buffer buffer.Add("abcd") // original Ident buffer.Add("abcj") - Assert.IsTrue buffer.Disabled - Assert.IsEmpty buffer + Assert.shouldBeTrue buffer.Disabled + Assert.shouldBeEmpty buffer [] let BufferShouldIgnoreSmallIdentifiers() = diff --git a/tests/FSharp.Test.Utilities/Assert.fs b/tests/FSharp.Test.Utilities/Assert.fs new file mode 100644 index 00000000000..2bb1d902afa --- /dev/null +++ b/tests/FSharp.Test.Utilities/Assert.fs @@ -0,0 +1,20 @@ +namespace FSharp.Test.Utilities + +module Assert = + open FluentAssertions + open System.Collections + + let inline shouldBe (expected : ^T) (actual : ^U) = + actual.Should().Be(expected, "") |> ignore + + let inline shouldBeEmpty (actual : ^T when ^T :> IEnumerable) = + actual.Should().BeEmpty("") |> ignore + + let inline shouldNotBeEmpty (actual : ^T when ^T :> IEnumerable) = + actual.Should().NotBeEmpty("") |> ignore + + let shouldBeFalse (actual: bool) = + actual.Should().BeFalse("") |> ignore + + let shouldBeTrue (actual: bool) = + actual.Should().BeTrue("") |> ignore diff --git a/tests/FSharp.Test.Utilities/FSharp.TestHelpers.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj similarity index 98% rename from tests/FSharp.Test.Utilities/FSharp.TestHelpers.fsproj rename to tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 3e186453ae8..6a11d62e4c2 100644 --- a/tests/FSharp.Test.Utilities/FSharp.TestHelpers.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -21,6 +21,7 @@ + From fe0302013f2a45de5f724aaf2843ee6c87cc53a6 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 9 Jun 2020 17:01:24 +0200 Subject: [PATCH 04/15] Remove old nunit helpers from Compler.UnitTests --- tests/FSharp.Compiler.UnitTests/NunitHelpers.fs | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 tests/FSharp.Compiler.UnitTests/NunitHelpers.fs diff --git a/tests/FSharp.Compiler.UnitTests/NunitHelpers.fs b/tests/FSharp.Compiler.UnitTests/NunitHelpers.fs deleted file mode 100644 index fb944f5af71..00000000000 --- a/tests/FSharp.Compiler.UnitTests/NunitHelpers.fs +++ /dev/null @@ -1,14 +0,0 @@ -namespace NUnit.Framework - -module Assert = - - let inline fail message = Assert.Fail message - - let inline failf fmt = Printf.kprintf fail fmt - - let inline areEqual (expected: ^T) (actual: ^T) = - Assert.shouldBe expected actual - -module StringAssert = - - let inline contains expected actual = StringAssert.Contains(expected, actual) From f13d49e5ee3af12fd4b6381fc4b7fb9d47dac457 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 9 Jun 2020 17:42:09 +0200 Subject: [PATCH 05/15] Use FluentAssertions in unit tests --- tests/FSharp.Compiler.UnitTests/FsiTests.fs | 3 +-- .../ManglingNameOfProvidedTypes.fs | 8 ++++---- .../FSharp.Compiler.UnitTests/SuggestionBuffer.fs | 10 +++++----- tests/FSharp.Test.Utilities/Assert.fs | 3 +++ tests/fsharp/FSharpSuite.Tests.fsproj | 6 ++---- tests/fsharp/NUnitHelpers.fs | 14 ++++++++++++++ 6 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 tests/fsharp/NUnitHelpers.fs diff --git a/tests/FSharp.Compiler.UnitTests/FsiTests.fs b/tests/FSharp.Compiler.UnitTests/FsiTests.fs index 5edebc0d478..2388a56a4bb 100644 --- a/tests/FSharp.Compiler.UnitTests/FsiTests.fs +++ b/tests/FSharp.Compiler.UnitTests/FsiTests.fs @@ -87,7 +87,7 @@ module FsiTests = let values = fsiSession.GetBoundValues() |> List.map (fun x -> x.Value.ReflectionValue) - Assert.shouldBe [4;7;6;5;1;2;3] values + Assert.shouldBeEquivalentTo [4;7;6;5;1;2;3] values [] let ``Seven bound values are ordered and have their correct type`` () = @@ -530,7 +530,6 @@ module FsiTests = type TestFSharpFunc() = inherit FSharpFunc() - override _.Invoke x = x type ``Test2FSharp @ Func``() = diff --git a/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs b/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs index 59eb909e7df..675a8cda713 100644 --- a/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs +++ b/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs @@ -26,19 +26,19 @@ type ManglingNamesOfProvidedTypesWithSingleParameter() = member this.DemangleNonDefaultValue() = let name, parameters = PrettyNaming.demangleProvidedTypeName "MyNamespace.Test,Foo=\"xyz\"" Assert.shouldBe "MyNamespace.Test" name - Assert.shouldBe [| "Foo", "xyz" |] parameters + Assert.shouldBeEquivalentTo [| "Foo", "xyz" |] parameters [] member this.DemangleDefaultValue() = let name, parameters = PrettyNaming.demangleProvidedTypeName "MyNamespace.Test," Assert.shouldBe "MyNamespace.Test" name - Assert.shouldBe [||] parameters + Assert.shouldBeEquivalentTo [||] parameters [] member this.DemangleNewDefaultValue() = let name, parameters = PrettyNaming.demangleProvidedTypeName "MyNamespace.Test" Assert.shouldBe "MyNamespace.Test" name - Assert.shouldBe [||] parameters + Assert.shouldBeEquivalentTo [||] parameters type ManglingNamesOfProvidedTypesWithMultipleParameter() = @@ -66,4 +66,4 @@ type ManglingNamesOfProvidedTypesWithMultipleParameter() = let name, parameters = PrettyNaming.demangleProvidedTypeName "TestType,Foo=\"xyz\",Foo2=\"abc\"" Assert.shouldBe "TestType" name Assert.shouldBe([| "Foo", "xyz" - "Foo2", "abc" |], parameters) \ No newline at end of file + "Foo2", "abc" |], parameters) diff --git a/tests/FSharp.Compiler.UnitTests/SuggestionBuffer.fs b/tests/FSharp.Compiler.UnitTests/SuggestionBuffer.fs index 00a40a93f83..f7d798a7d1a 100644 --- a/tests/FSharp.Compiler.UnitTests/SuggestionBuffer.fs +++ b/tests/FSharp.Compiler.UnitTests/SuggestionBuffer.fs @@ -23,7 +23,7 @@ module SuggestionBuffer = let results = Array.ofSeq buffer - Assert.shouldBe [| "abce" |] results + Assert.shouldBeEquivalentTo [| "abce" |] results [] let SmallIdentifierShouldBeIgnored() = @@ -42,7 +42,7 @@ module SuggestionBuffer = let results = Array.ofSeq buffer Assert.shouldBeTrue buffer.Disabled - Assert.shouldBe [||] results + Assert.shouldBeEquivalentTo [||] results [] let BufferShouldOnlyTakeTop5Elements() = @@ -57,7 +57,7 @@ module SuggestionBuffer = let results = Array.ofSeq buffer - Assert.shouldBe [| "abce"; "abcg"; "abch"; "abci"; "abcj"|] results + Assert.shouldBeEquivalentTo [| "abce"; "abcg"; "abch"; "abci"; "abcj"|] results [] let BufferShouldUseEarlierElementsIfTheyHaveSameScore() = @@ -71,7 +71,7 @@ module SuggestionBuffer = let results = Array.ofSeq buffer - Assert.shouldBe [| "abce"; "abcf"; "abcg"; "abch"; "abci"|] results + Assert.shouldBeEquivalentTo [| "abce"; "abcf"; "abcg"; "abch"; "abci"|] results [] @@ -101,4 +101,4 @@ module SuggestionBuffer = let results = Array.ofSeq buffer - Assert.shouldBe [| "abc"; "abce" |] results \ No newline at end of file + Assert.shouldBeEquivalentTo [| "abc"; "abce" |] results diff --git a/tests/FSharp.Test.Utilities/Assert.fs b/tests/FSharp.Test.Utilities/Assert.fs index 2bb1d902afa..d059337834e 100644 --- a/tests/FSharp.Test.Utilities/Assert.fs +++ b/tests/FSharp.Test.Utilities/Assert.fs @@ -4,6 +4,9 @@ module Assert = open FluentAssertions open System.Collections + let inline shouldBeEquivalentTo (expected : ^T) (actual : ^U) = + actual.Should().BeEquivalentTo(expected, "") |> ignore + let inline shouldBe (expected : ^T) (actual : ^U) = actual.Should().Be(expected, "") |> ignore diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index bf896e7a5de..ca9ebb93805 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -20,9 +20,7 @@ scriptlib.fsx - - NunitHelpers.fs - + @@ -93,7 +91,7 @@ - + diff --git a/tests/fsharp/NUnitHelpers.fs b/tests/fsharp/NUnitHelpers.fs new file mode 100644 index 00000000000..6af423d9b7c --- /dev/null +++ b/tests/fsharp/NUnitHelpers.fs @@ -0,0 +1,14 @@ +namespace NUnit.Framework + +module Assert = + + let inline fail message = Assert.Fail message + + let inline failf fmt = Printf.kprintf fail fmt + + let inline areEqual (expected: ^T) (actual: ^T) = + Assert.AreEqual(expected, actual) + +module StringAssert = + + let inline contains expected actual = StringAssert.Contains(expected, actual) From 79846a4f049784333bcefb1c2b6384c8e42c399d Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 9 Jun 2020 18:56:42 +0200 Subject: [PATCH 06/15] Added new xUnit test project Compiler.UnitTests --- FSharp.sln | 15 ++++++++ VisualFSharp.sln | 15 ++++++++ eng/Build.ps1 | 2 + eng/build.sh | 1 + .../Directory.Build.props | 9 +++++ .../InvalidNumericLiteralTests.fs | 7 ++-- .../FSharp.Compiler.ComponentTests.fsproj | 37 +++++++++++++++++++ .../FSharp.Compiler.UnitTests.fsproj | 2 +- 8 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Directory.Build.props rename tests/{fsharp/Compiler => FSharp.Compiler.ComponentTests}/ErrorMessages/InvalidNumericLiteralTests.fs (89%) create mode 100644 tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj diff --git a/FSharp.sln b/FSharp.sln index 5302949640d..f15241ad420 100644 --- a/FSharp.sln +++ b/FSharp.sln @@ -52,6 +52,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Private.Scr EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "DependencyManager", "src\fsharp\Microsoft.DotNet.DependencyManager\Microsoft.DotNet.DependencyManager.fsproj", "{B5A043F8-6D7F-4D4E-B8AD-5880070180B6}" EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.ComponentTests", "tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj", "{FAC5A3BF-C0D6-437A-868A-E962AA00B418}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -278,6 +280,18 @@ Global {B5A043F8-6D7F-4D4E-B8AD-5880070180B6}.Release|Any CPU.Build.0 = Release|Any CPU {B5A043F8-6D7F-4D4E-B8AD-5880070180B6}.Release|x86.ActiveCfg = Release|Any CPU {B5A043F8-6D7F-4D4E-B8AD-5880070180B6}.Release|x86.Build.0 = Release|Any CPU + {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Debug|x86.ActiveCfg = Debug|Any CPU + {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Debug|x86.Build.0 = Debug|Any CPU + {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Proto|Any CPU.Build.0 = Debug|Any CPU + {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Proto|x86.ActiveCfg = Debug|Any CPU + {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Proto|x86.Build.0 = Debug|Any CPU + {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Release|Any CPU.Build.0 = Release|Any CPU + {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Release|x86.ActiveCfg = Release|Any CPU + {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -300,6 +314,7 @@ Global {6771860A-614D-4FDD-A655-4C70EBCC91B0} = {B8DDA694-7939-42E3-95E5-265C2217C142} {4FEDF286-0252-4EBC-9E75-879CCA3B85DC} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {B5A043F8-6D7F-4D4E-B8AD-5880070180B6} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77} + {FAC5A3BF-C0D6-437A-868A-E962AA00B418} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BD5177C7-1380-40E7-94D2-7768E1A8B1B8} diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 6649fa2074b..5c0004e794e 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -160,6 +160,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TutorialProject", "vsintegr EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Microsoft.DotNet.DependencyManager", "src\fsharp\Microsoft.DotNet.DependencyManager\Microsoft.DotNet.DependencyManager.fsproj", "{C2F38485-5F87-4986-985B-55D7ED96D5CE}" EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.ComponentTests", "tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj", "{0610FB97-7C15-422A-86FD-32335C6DF14D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -938,6 +940,18 @@ Global {C2F38485-5F87-4986-985B-55D7ED96D5CE}.Release|Any CPU.Build.0 = Release|Any CPU {C2F38485-5F87-4986-985B-55D7ED96D5CE}.Release|x86.ActiveCfg = Release|Any CPU {C2F38485-5F87-4986-985B-55D7ED96D5CE}.Release|x86.Build.0 = Release|Any CPU + {0610FB97-7C15-422A-86FD-32335C6DF14D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0610FB97-7C15-422A-86FD-32335C6DF14D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0610FB97-7C15-422A-86FD-32335C6DF14D}.Debug|x86.ActiveCfg = Debug|Any CPU + {0610FB97-7C15-422A-86FD-32335C6DF14D}.Debug|x86.Build.0 = Debug|Any CPU + {0610FB97-7C15-422A-86FD-32335C6DF14D}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {0610FB97-7C15-422A-86FD-32335C6DF14D}.Proto|Any CPU.Build.0 = Debug|Any CPU + {0610FB97-7C15-422A-86FD-32335C6DF14D}.Proto|x86.ActiveCfg = Debug|Any CPU + {0610FB97-7C15-422A-86FD-32335C6DF14D}.Proto|x86.Build.0 = Debug|Any CPU + {0610FB97-7C15-422A-86FD-32335C6DF14D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0610FB97-7C15-422A-86FD-32335C6DF14D}.Release|Any CPU.Build.0 = Release|Any CPU + {0610FB97-7C15-422A-86FD-32335C6DF14D}.Release|x86.ActiveCfg = Release|Any CPU + {0610FB97-7C15-422A-86FD-32335C6DF14D}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1013,6 +1027,7 @@ Global {B53D9D05-8EF7-43A6-9A5B-0B113CBC54F8} = {12EF27FD-A34B-4373-860A-F9FCE9651859} {2937CBEC-262D-4C94-BE1D-291FAB72E3E8} = {12EF27FD-A34B-4373-860A-F9FCE9651859} {C2F38485-5F87-4986-985B-55D7ED96D5CE} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77} + {0610FB97-7C15-422A-86FD-32335C6DF14D} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37} diff --git a/eng/Build.ps1 b/eng/Build.ps1 index efc0c86529f..ea171d69b09 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -451,6 +451,7 @@ try { $coreclrTargetFramework = "netcoreapp3.0" if ($testDesktop -and -not $noVisualStudio) { + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $desktopTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $desktopTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $desktopTargetFramework @@ -459,6 +460,7 @@ try { } if ($testCoreClr) { + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $coreclrTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $coreclrTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $coreclrTargetFramework diff --git a/eng/build.sh b/eng/build.sh index a862cb9f385..4b7154f880f 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -294,6 +294,7 @@ BuildSolution if [[ "$test_core_clr" == true ]]; then coreclrtestframework=netcoreapp3.0 + TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj" --targetframework $coreclrtestframework TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj" --targetframework $coreclrtestframework TestUsingNUnit --testproject "$repo_root/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj" --targetframework $coreclrtestframework diff --git a/tests/FSharp.Compiler.ComponentTests/Directory.Build.props b/tests/FSharp.Compiler.ComponentTests/Directory.Build.props new file mode 100644 index 00000000000..7cd41381b5d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Directory.Build.props @@ -0,0 +1,9 @@ + + + + true + + + + + diff --git a/tests/fsharp/Compiler/ErrorMessages/InvalidNumericLiteralTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/InvalidNumericLiteralTests.fs similarity index 89% rename from tests/fsharp/Compiler/ErrorMessages/InvalidNumericLiteralTests.fs rename to tests/FSharp.Compiler.ComponentTests/ErrorMessages/InvalidNumericLiteralTests.fs index 6c8be402844..c6631ab629e 100644 --- a/tests/fsharp/Compiler/ErrorMessages/InvalidNumericLiteralTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/InvalidNumericLiteralTests.fs @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace FSharp.Compiler.UnitTests +namespace FSharp.Compiler.ComponentTests -open NUnit.Framework +open Xunit open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices -[] module ``Invalid Numeric Literal`` = - [] + [] let ``1up is invalid Numeric Literal``() = CompilerAssert.TypeCheckSingleError """ diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj new file mode 100644 index 00000000000..a7ac6f7c5b9 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -0,0 +1,37 @@ + + + + + + net472;netcoreapp3.0 + netcoreapp3.0 + Library + true + $(OtherFlags) --warnon:1182 + xunit + $(NoWarn);3186;1104 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj index 057dc38c692..a5631af247f 100644 --- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj +++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj @@ -8,7 +8,7 @@ Library true xunit - $(NoWarn);3186;1104;NETSDK1023 + $(NoWarn);3186;1104 From da2d7f0d7644f2bed4a39aec7dc870411d86d843 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 10 Jun 2020 14:43:53 +0200 Subject: [PATCH 07/15] Fixed CompilerAssert for non-windows; Updated README --- FSharp.sln | 24 ++++ .../FSharp.Compiler.ComponentTests.fsproj | 5 +- tests/FSharp.Test.Utilities/CompilerAssert.fs | 3 +- .../FSharp.Test.Utilities.fsproj | 2 +- tests/FSharp.Test.Utilities/TestFramework.fs | 112 ++++++++++++------ tests/README.md | 7 +- tests/fsharp/FSharpSuite.Tests.fsproj | 1 - .../testenv/src/PEVerify/PEVerify.csproj | 3 +- 8 files changed, 111 insertions(+), 46 deletions(-) diff --git a/FSharp.sln b/FSharp.sln index f15241ad420..b6509cdb8d6 100644 --- a/FSharp.sln +++ b/FSharp.sln @@ -54,6 +54,14 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "DependencyManager", "src\fs EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.ComponentTests", "tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj", "{FAC5A3BF-C0D6-437A-868A-E962AA00B418}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fsharpqa", "fsharpqa", "{292C4F92-A313-4CAF-9552-731F39C6C21F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testenv", "testenv", "{FF76050A-415A-4FB4-A0E5-13CBF38D83E0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{07482B5E-4980-4285-B732-820F15870284}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PEVerify", "tests\fsharpqa\testenv\src\PEVerify\PEVerify.csproj", "{25568CD2-E654-4C8F-BE5B-59BABFC5BD20}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -292,6 +300,18 @@ Global {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Release|Any CPU.Build.0 = Release|Any CPU {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Release|x86.ActiveCfg = Release|Any CPU {FAC5A3BF-C0D6-437A-868A-E962AA00B418}.Release|x86.Build.0 = Release|Any CPU + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20}.Debug|Any CPU.Build.0 = Debug|Any CPU + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20}.Debug|x86.ActiveCfg = Debug|Any CPU + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20}.Debug|x86.Build.0 = Debug|Any CPU + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20}.Proto|Any CPU.Build.0 = Debug|Any CPU + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20}.Proto|x86.ActiveCfg = Debug|Any CPU + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20}.Proto|x86.Build.0 = Debug|Any CPU + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20}.Release|Any CPU.ActiveCfg = Release|Any CPU + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20}.Release|Any CPU.Build.0 = Release|Any CPU + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20}.Release|x86.ActiveCfg = Release|Any CPU + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -315,6 +335,10 @@ Global {4FEDF286-0252-4EBC-9E75-879CCA3B85DC} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {B5A043F8-6D7F-4D4E-B8AD-5880070180B6} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77} {FAC5A3BF-C0D6-437A-868A-E962AA00B418} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} + {292C4F92-A313-4CAF-9552-731F39C6C21F} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} + {FF76050A-415A-4FB4-A0E5-13CBF38D83E0} = {292C4F92-A313-4CAF-9552-731F39C6C21F} + {07482B5E-4980-4285-B732-820F15870284} = {FF76050A-415A-4FB4-A0E5-13CBF38D83E0} + {25568CD2-E654-4C8F-BE5B-59BABFC5BD20} = {07482B5E-4980-4285-B732-820F15870284} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BD5177C7-1380-40E7-94D2-7768E1A8B1B8} diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index a7ac6f7c5b9..a745b2226dd 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -5,11 +5,14 @@ net472;netcoreapp3.0 netcoreapp3.0 + true Library true + false + false $(OtherFlags) --warnon:1182 xunit - $(NoWarn);3186;1104 + $(NoWarn);3186;1104;FS0988 diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index 873a2166517..9acbb1e10f2 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -125,7 +125,6 @@ let main argv = 0""" File.WriteAllText(programFsFileName, programFs) let pInfo = ProcessStartInfo () - pInfo.FileName <- config.DotNetExe pInfo.Arguments <- "build" pInfo.WorkingDirectory <- projectDirectory @@ -147,7 +146,7 @@ let main argv = 0""" cleanUp <- false printfn "%s" output printfn "%s" errors - raise (new Exception (sprintf "An error occured getting netcoreapp references: %A" e)) + raise (new Exception (sprintf "An error occurred getting netcoreapp references: %A" e)) finally if cleanUp then try Directory.Delete(projectDirectory) with | _ -> () diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 6a11d62e4c2..43684fa41bd 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -3,7 +3,7 @@ net472;netcoreapp3.0 netcoreapp3.0 - win-x86;win-x64 + win-x86;win-x64;linux-x64;osx-x64 $(AssetTargetFallback);portable-net45+win8+wp8+wpa81 true Library diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index 63ab601024b..694b625bade 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -142,28 +142,57 @@ type TestConfig = DotNetExe: string DefaultPlatform: string} +#if NETCOREAPP +open System.Runtime.InteropServices +#endif -module WindowsPlatform = - let Is64BitOperatingSystem envVars = - // On Windows PROCESSOR_ARCHITECTURE has the value AMD64 on 64 bit Intel Machines - let value = - let find s = envVars |> Map.tryFind s - [| "PROCESSOR_ARCHITECTURE" |] |> Seq.tryPick (fun s -> find s) |> function None -> "" | Some x -> x - value = "AMD64" +let getOperatingSystem () = +#if NETCOREAPP + let isPlatform p = RuntimeInformation.IsOSPlatform(p) + if isPlatform OSPlatform.Windows then "win" + elif isPlatform OSPlatform.Linux then "linux" + elif isPlatform OSPlatform.OSX then "osx" + else "unknown" +#else + "win" +#endif -type FSLibPaths = +module DotnetPlatform = + let Is64BitOperatingSystem envVars = + match getOperatingSystem () with + | "win" -> + // On Windows PROCESSOR_ARCHITECTURE has the value AMD64 on 64 bit Intel Machines + let value = + let find s = envVars |> Map.tryFind s + [| "PROCESSOR_ARCHITECTURE" |] |> Seq.tryPick (fun s -> find s) |> function None -> "" | Some x -> x + value = "AMD64" + | _ -> System.Environment.Is64BitOperatingSystem // As an alternative for netstandard1.4+: System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture + +type FSLibPaths = { FSCOREDLLPATH : string } -let requireFile nm = - if Commands.fileExists __SOURCE_DIRECTORY__ nm |> Option.isSome then nm else failwith (sprintf "couldn't find %s. Running 'build test' once might solve this issue" nm) - -let packagesDir = - match Environment.GetEnvironmentVariable("NUGET_PACKAGES") with - | null -> Environment.GetEnvironmentVariable("USERPROFILE") ++ ".nuget" ++ "packages" - | path -> path +let getPackagesDir () = + let p = match Environment.GetEnvironmentVariable("NUGET_PACKAGES") with + | null -> + match Environment.GetEnvironmentVariable("USERPROFILE") with + | null -> Environment.GetEnvironmentVariable("HOME") + | p -> p + | path -> path + p ++ ".nuget" ++ "packages" + +let requireFile dir path = + // Linux filesystems are (in most cases) case-sensitive. + // However when nuget packages are installed to $HOME/.nuget/packages, it seems they are lowercased + let fullPath = (dir ++ path) + match Commands.fileExists __SOURCE_DIRECTORY__ fullPath with + | Some p -> p + | None -> + let fullPathLower = (dir ++ path.ToLower()) + match Commands.fileExists __SOURCE_DIRECTORY__ fullPathLower with + | Some p -> p + | None -> failwith (sprintf "Couldn't find \"%s\" on the following paths: \"%s\", \"%s\". Running 'build test' once might solve this issue" path fullPath fullPathLower) let config configurationName envVars = - let SCRIPT_ROOT = __SOURCE_DIRECTORY__ #if NET472 let fscArchitecture = "net472" @@ -171,12 +200,14 @@ let config configurationName envVars = let fsharpCoreArchitecture = "net45" let fsharpBuildArchitecture = "net472" let fsharpCompilerInteractiveSettingsArchitecture = "net472" + let peverifyArchitecture = "net472" #else let fscArchitecture = "netcoreapp3.0" let fsiArchitecture = "netcoreapp3.0" let fsharpCoreArchitecture = "netstandard2.0" let fsharpBuildArchitecture = "netcoreapp3.0" let fsharpCompilerInteractiveSettingsArchitecture = "netstandard2.0" + let peverifyArchitecture = "netcoreapp3.0" #endif let repoRoot = SCRIPT_ROOT ++ ".." ++ ".." let artifactsPath = repoRoot ++ "artifacts" @@ -185,31 +216,42 @@ let config configurationName envVars = let csc_flags = "/nologo" let fsc_flags = "-r:System.Core.dll --nowarn:20 --define:COMPILED" let fsi_flags = "-r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror" - let Is64BitOperatingSystem = WindowsPlatform.Is64BitOperatingSystem envVars + let operatingSystem = getOperatingSystem () + let Is64BitOperatingSystem = DotnetPlatform.Is64BitOperatingSystem envVars let architectureMoniker = if Is64BitOperatingSystem then "x64" else "x86" - let CSC = requireFile (packagesDir ++ "Microsoft.Net.Compilers" ++ "2.7.0" ++ "tools" ++ "csc.exe") - let ILDASM = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.ILDAsm") ++ coreClrRuntimePackageVersion ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "ildasm.exe") - let ILASM = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.ILAsm") ++ coreClrRuntimePackageVersion ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "ilasm.exe") - let coreclrdll = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.Runtime.CoreCLR") ++ coreClrRuntimePackageVersion ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "coreclr.dll") - let PEVERIFY = requireFile (artifactsBinPath ++ "PEVerify" ++ configurationName ++ "net472" ++ "PEVerify.exe") - let FSI_FOR_SCRIPTS = artifactsBinPath ++ "fsi" ++ configurationName ++ fsiArchitecture ++ "fsi.exe" - let FSharpBuild = requireFile (artifactsBinPath ++ "FSharp.Build" ++ configurationName ++ fsharpBuildArchitecture ++ "FSharp.Build.dll") - let FSharpCompilerInteractiveSettings = requireFile (artifactsBinPath ++ "FSharp.Compiler.Interactive.Settings" ++ configurationName ++ fsharpCompilerInteractiveSettingsArchitecture ++ "FSharp.Compiler.Interactive.Settings.dll") + let packagesDir = getPackagesDir () + let requirePackage = requireFile packagesDir + let requireArtifact = requireFile artifactsBinPath + let CSC = requirePackage ("Microsoft.Net.Compilers" ++ "2.7.0" ++ "tools" ++ "csc.exe") + let ILDASM_EXE = if operatingSystem = "windows" then "ildasm.exe" else "ildasm" + let ILDASM = requirePackage (("runtime." + operatingSystem + "-" + architectureMoniker + ".Microsoft.NETCore.ILDAsm") ++ coreClrRuntimePackageVersion ++ "runtimes" ++ (operatingSystem + "-" + architectureMoniker) ++ "native" ++ ILDASM_EXE) + let ILASM_EXE = if operatingSystem = "windows" then "ilasm.exe" else "ilasm" + let ILASM = requirePackage (("runtime." + operatingSystem + "-" + architectureMoniker + ".Microsoft.NETCore.ILAsm") ++ coreClrRuntimePackageVersion ++ "runtimes" ++ (operatingSystem + "-" + architectureMoniker) ++ "native" ++ ILASM_EXE) + let CORECLR_DLL = if operatingSystem = "windows" then "coreclr.dll" elif operatingSystem = "osx" then "libcoreclr.dylib" else "libcoreclr.so" + let coreclrdll = requirePackage (("runtime." + operatingSystem + "-" + architectureMoniker + ".Microsoft.NETCore.Runtime.CoreCLR") ++ coreClrRuntimePackageVersion ++ "runtimes" ++ (operatingSystem + "-" + architectureMoniker) ++ "native" ++ CORECLR_DLL) + let PEVERIFY_EXE = if operatingSystem = "windows" then "PEVerify.exe" else "PEVerify" + let PEVERIFY = requireArtifact ("PEVerify" ++ configurationName ++ peverifyArchitecture ++ PEVERIFY_EXE) + let FSharpBuild = requireArtifact ("FSharp.Build" ++ configurationName ++ fsharpBuildArchitecture ++ "FSharp.Build.dll") + let FSharpCompilerInteractiveSettings = requireArtifact ("FSharp.Compiler.Interactive.Settings" ++ configurationName ++ fsharpCompilerInteractiveSettingsArchitecture ++ "FSharp.Compiler.Interactive.Settings.dll") + let dotNetExe = // first look for {repoRoot}\.dotnet\dotnet.exe, otherwise fallback to %PATH% - let repoLocalDotnetPath = repoRoot ++ ".dotnet" ++ "dotnet.exe" + let DOTNET_EXE = if operatingSystem = "windows" then "dotnet.exe" else "dotnet" + let repoLocalDotnetPath = repoRoot ++ ".dotnet" ++ DOTNET_EXE if File.Exists(repoLocalDotnetPath) then repoLocalDotnetPath - else "dotnet.exe" + else DOTNET_EXE + // ildasm + ilasm requires coreclr.dll to run which has already been restored to the packages directory - File.Copy(coreclrdll, Path.GetDirectoryName(ILDASM) ++ "coreclr.dll", overwrite=true) - File.Copy(coreclrdll, Path.GetDirectoryName(ILASM) ++ "coreclr.dll", overwrite=true) + File.Copy(coreclrdll, Path.GetDirectoryName(ILDASM) ++ CORECLR_DLL, overwrite=true) + File.Copy(coreclrdll, Path.GetDirectoryName(ILASM) ++ CORECLR_DLL, overwrite=true) - let FSI = requireFile (FSI_FOR_SCRIPTS) + let FSI_FOR_SCRIPTS = ("fsi" ++ configurationName ++ fsiArchitecture ++ "fsi.exe") + let FSI = requireArtifact FSI_FOR_SCRIPTS #if !NETCOREAPP - let FSIANYCPU = requireFile (artifactsBinPath ++ "fsiAnyCpu" ++ configurationName ++ "net472" ++ "fsiAnyCpu.exe") + let FSIANYCPU = requireArtifact ("fsiAnyCpu" ++ configurationName ++ "net472" ++ "fsiAnyCpu.exe") #endif - let FSC = requireFile (artifactsBinPath ++ "fsc" ++ configurationName ++ fscArchitecture ++ "fsc.exe") - let FSCOREDLLPATH = requireFile (artifactsBinPath ++ "FSharp.Core" ++ configurationName ++ fsharpCoreArchitecture ++ "FSharp.Core.dll") + let FSC = requireArtifact ("fsc" ++ configurationName ++ fscArchitecture ++ "fsc.exe") + let FSCOREDLLPATH = requireArtifact ("FSharp.Core" ++ configurationName ++ fsharpCoreArchitecture ++ "FSharp.Core.dll") let defaultPlatform = match Is64BitOperatingSystem with @@ -279,9 +321,9 @@ let envVars () = let initializeSuite () = #if DEBUG - let configurationName = "debug" + let configurationName = "Debug" #else - let configurationName = "release" + let configurationName = "Release" #endif let env = envVars () diff --git a/tests/README.md b/tests/README.md index 29a80031a1d..59ad0678aac 100644 --- a/tests/README.md +++ b/tests/README.md @@ -93,10 +93,9 @@ Existing FSharpQA and Cambridge need to be migrated to corresponding test projec ## Next steps -* [**In Progress**] Move `FSharp.TestHelpers` to `FSharp.Test.Utilities`. -* [**In Progress**] Create initial test projects structure for new tests (`FSharp.Compiler.ComponentTests`). * [**In Progress**] Migrate existing `NUnit` tests to xUnit. -* [**In progress**] Change build scripts to run new suites as well as old ones. +* Clean up CompilerAssert. +* Make PEVerify tests work in netcore/non-windows environment. * Start migration of existing (namely, FSharpQA and Cambridge) suites to xUnit-based projects. ## Open questions: @@ -108,5 +107,3 @@ Existing FSharpQA and Cambridge need to be migrated to corresponding test projec Related issues: (https://github.com/dotnet/fsharp/issues/7075) You can find this document under 'tests/README.md'. - -**I would like to hear some feedback the community, so we can quickly re-iterate over it (if needed), and start working :)** \ No newline at end of file diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index ca9ebb93805..2b44270fbb6 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -49,7 +49,6 @@ - diff --git a/tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj b/tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj index 47555139254..51bc50b289b 100644 --- a/tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj +++ b/tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj @@ -2,7 +2,8 @@ Exe - net472 + net472;netcoreapp3.0 + netcoreapp3.0 $(NoWarn);1591 From 34d43b2864bd13c1f5a3dcad2edc039729c47b56 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii <1260985+vzarytovskii@users.noreply.github.com> Date: Mon, 15 Jun 2020 12:09:27 +0200 Subject: [PATCH 08/15] Fix paths when search for nuget packages --- tests/FSharp.Test.Utilities/TestFramework.fs | 84 ++++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index 694b625bade..c96c6d80747 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -18,13 +18,13 @@ module Commands = else Path.Combine(workDir, path) rooted |> Path.GetFullPath - let fileExists workDir path = + let fileExists workDir path = if path |> getfullpath workDir |> File.Exists then Some path else None - let directoryExists workDir path = + let directoryExists workDir path = if path |> getfullpath workDir |> Directory.Exists then Some path else None - let copy_y workDir source dest = + let copy_y workDir source dest = log "copy /y %s %s" source dest File.Copy( source |> getfullpath workDir, dest |> getfullpath workDir, true) CmdResult.Success @@ -35,7 +35,7 @@ module Commands = let rm dir path = let p = path |> getfullpath dir - if File.Exists(p) then + if File.Exists(p) then (log "rm %s" p) |> ignore File.Delete(p) else @@ -43,16 +43,16 @@ module Commands = let rmdir dir path = let p = path |> getfullpath dir - if Directory.Exists(p) then + if Directory.Exists(p) then (log "rmdir /sy %s" p) |> ignore Directory.Delete(p, true) else (log "not found: %s p") |> ignore - let pathAddBackslash (p: FilePath) = + let pathAddBackslash (p: FilePath) = if String.IsNullOrWhiteSpace (p) then p else - p.TrimEnd ([| Path.DirectorySeparatorChar; Path.AltDirectorySeparatorChar |]) + p.TrimEnd ([| Path.DirectorySeparatorChar; Path.AltDirectorySeparatorChar |]) + Path.DirectorySeparatorChar.ToString() let echoAppendToFile workDir text p = @@ -78,11 +78,11 @@ module Commands = match exitCode with | 0 -> CmdResult.Success - | err -> - let msg = sprintf "Error running command '%s' with args '%s' in directory '%s'" fscExe args workDir + | err -> + let msg = sprintf "Error running command '%s' with args '%s' in directory '%s'" fscExe args workDir CmdResult.ErrorLevel (msg, err) #else - ignore workDir + ignore workDir #if NETCOREAPP exec dotNetExe (fscExe + " " + args) #else @@ -119,7 +119,7 @@ module Commands = path -type TestConfig = +type TestConfig = { EnvironmentVariables : Map CSC : string csc_flags : string @@ -138,7 +138,7 @@ type TestConfig = ILDASM : string ILASM : string PEVERIFY : string - Directory: string + Directory: string DotNetExe: string DefaultPlatform: string} @@ -185,11 +185,11 @@ let requireFile dir path = // However when nuget packages are installed to $HOME/.nuget/packages, it seems they are lowercased let fullPath = (dir ++ path) match Commands.fileExists __SOURCE_DIRECTORY__ fullPath with - | Some p -> p + | Some _ -> fullPath | None -> let fullPathLower = (dir ++ path.ToLower()) match Commands.fileExists __SOURCE_DIRECTORY__ fullPathLower with - | Some p -> p + | Some _ -> fullPathLower | None -> failwith (sprintf "Couldn't find \"%s\" on the following paths: \"%s\", \"%s\". Running 'build test' once might solve this issue" path fullPath fullPathLower) let config configurationName envVars = @@ -213,7 +213,7 @@ let config configurationName envVars = let artifactsPath = repoRoot ++ "artifacts" let artifactsBinPath = artifactsPath ++ "bin" let coreClrRuntimePackageVersion = "3.0.0-preview-27318-01" - let csc_flags = "/nologo" + let csc_flags = "/nologo" let fsc_flags = "-r:System.Core.dll --nowarn:20 --define:COMPILED" let fsi_flags = "-r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror" let operatingSystem = getOperatingSystem () @@ -253,8 +253,8 @@ let config configurationName envVars = let FSC = requireArtifact ("fsc" ++ configurationName ++ fscArchitecture ++ "fsc.exe") let FSCOREDLLPATH = requireArtifact ("FSharp.Core" ++ configurationName ++ fsharpCoreArchitecture ++ "FSharp.Core.dll") - let defaultPlatform = - match Is64BitOperatingSystem with + let defaultPlatform = + match Is64BitOperatingSystem with // | PlatformID.MacOSX, true -> "osx.10.10-x64" // | PlatformID.Unix,true -> "ubuntu.14.04-x64" | true -> "win7-x64" @@ -265,7 +265,7 @@ let config configurationName envVars = ILDASM = ILDASM ILASM = ILASM PEVERIFY = PEVERIFY - CSC = CSC + CSC = CSC BUILD_CONFIG = configurationName FSC = FSC FSI = FSI @@ -276,9 +276,9 @@ let config configurationName envVars = FSharpBuild = FSharpBuild FSharpCompilerInteractiveSettings = FSharpCompilerInteractiveSettings csc_flags = csc_flags - fsc_flags = fsc_flags - fsi_flags = fsi_flags - Directory="" + fsc_flags = fsc_flags + fsi_flags = fsi_flags + Directory="" DotNetExe = dotNetExe DefaultPlatform = defaultPlatform } @@ -302,18 +302,18 @@ let logConfig (cfg: TestConfig) = log "---------------------------------------------------------------" -let checkResult result = +let checkResult result = match result with | CmdResult.ErrorLevel (msg1, err) -> Assert.Fail (sprintf "%s. ERRORLEVEL %d" msg1 err) | CmdResult.Success -> () -let checkErrorLevel1 result = +let checkErrorLevel1 result = match result with | CmdResult.ErrorLevel (_,1) -> () | CmdResult.Success | CmdResult.ErrorLevel _ -> Assert.Fail (sprintf "Command passed unexpectedly") -let envVars () = - System.Environment.GetEnvironmentVariables () +let envVars () = + System.Environment.GetEnvironmentVariables () |> Seq.cast |> Seq.map (fun d -> d.Key :?> string, d.Value :?> string) |> Map.ofSeq @@ -329,7 +329,7 @@ let initializeSuite () = let cfg = let c = config configurationName env - let usedEnvVars = c.EnvironmentVariables |> Map.add "FSC" c.FSC + let usedEnvVars = c.EnvironmentVariables |> Map.add "FSC" c.FSC { c with EnvironmentVariables = usedEnvVars } logConfig cfg @@ -345,7 +345,7 @@ type public InitializeSuiteAttribute () = override x.BeforeTest details = try - if details.IsSuite + if details.IsSuite then suiteHelpers.Force() |> ignore with | e -> raise (Exception("failed test suite initialization, debug code in InitializeSuiteAttribute", e)) @@ -376,28 +376,28 @@ type FileGuard(path: string) = member x.Path = path member x.Exists = x.Path |> File.Exists member x.CheckExists() = - if not x.Exists then + if not x.Exists then failwith (sprintf "exit code 0 but %s file doesn't exists" (x.Path |> Path.GetFileName)) interface IDisposable with member x.Dispose () = remove path - -type RedirectToType = + +type RedirectToType = | Overwrite of FilePath | Append of FilePath -type RedirectTo = +type RedirectTo = | Inherit | Output of RedirectToType | OutputAndError of RedirectToType * RedirectToType - | OutputAndErrorToSameFile of RedirectToType + | OutputAndErrorToSameFile of RedirectToType | Error of RedirectToType -type RedirectFrom = +type RedirectFrom = | RedirectInput of FilePath -type RedirectInfo = +type RedirectInfo = { Output : RedirectTo Input : RedirectFrom option } @@ -415,7 +415,7 @@ module Command = | Inherit -> "" | Output r-> sprintf " 1%s" (redirectType r) | OutputAndError (r1, r2) -> sprintf " 1%s 2%s" (redirectType r1) (redirectType r2) - | OutputAndErrorToSameFile r -> sprintf " 1%s 2>1" (redirectType r) + | OutputAndErrorToSameFile r -> sprintf " 1%s 2>1" (redirectType r) | Error r -> sprintf " 2%s" (redirectType r) sprintf "%s%s%s%s" path (match args with "" -> "" | x -> " " + x) (inF redirect.Input) (outF redirect.Output) @@ -444,13 +444,13 @@ module Command = let openWrite rt = let fullpath = Commands.getfullpath dir - match rt with + match rt with | Append p -> File.AppendText( p |> fullpath) | Overwrite p -> new StreamWriter(new FileStream(p |> fullpath, FileMode.Create)) let outF fCont cmdArgs = match redirect.Output with - | RedirectTo.Inherit -> + | RedirectTo.Inherit -> use toLog = redirectToLog () fCont { cmdArgs with RedirectOutput = Some (toLog.Post); RedirectError = Some (toLog.Post) } | Output r -> @@ -473,7 +473,7 @@ module Command = use outFile = redirectTo writer use toLog = redirectToLog () fCont { cmdArgs with RedirectOutput = Some (toLog.Post); RedirectError = Some (outFile.Post) } - + let exec cmdArgs = log "%s" (logExec dir path args redirect) Process.exec cmdArgs dir envVars path args @@ -533,7 +533,7 @@ let diff normalize path1 path2 = if not <| File.Exists(path1) then // creating empty baseline file as this is likely someone initializing a new test - File.WriteAllText(path1, String.Empty) + File.WriteAllText(path1, String.Empty) if not <| File.Exists(path2) then failwithf "Invalid path %s" path2 let lines1 = File.ReadAllLines(path1) @@ -565,7 +565,7 @@ let diff normalize path1 path2 = result.ToString() -let fsdiff cfg a b = +let fsdiff cfg a b = let actualFile = System.IO.Path.Combine(cfg.Directory, a) let expectedFile = System.IO.Path.Combine(cfg.Directory, b) let errorText = System.IO.File.ReadAllText (System.IO.Path.Combine(cfg.Directory, a)) @@ -577,8 +577,8 @@ let fsdiff cfg a b = log "%s" errorText result - -let requireENCulture () = + +let requireENCulture () = match System.Globalization.CultureInfo.CurrentCulture.TwoLetterISOLanguageName with | "en" -> true | _ -> false From 201b8dbd886118e2f13afc8c5c0b77c7afc0094a Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii <1260985+vzarytovskii@users.noreply.github.com> Date: Mon, 15 Jun 2020 12:33:25 +0200 Subject: [PATCH 09/15] Fix tests post-merge (FSharp.TestHelpers -> FSHapr.Test.Utilities) --- .../Compiler/CodeGen/EmittedIL/CeEdiThrow.fs | 2 +- .../Language/ComputationExpressionTests.fs | 24 +++++++++---------- .../LanguagePrimitives/ComparisonTests.fs | 2 +- .../LanguagePrimitives/StringFormatTests.fs | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/CeEdiThrow.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/CeEdiThrow.fs index 91ad61dc939..22d6b93df39 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/CeEdiThrow.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/CeEdiThrow.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL open FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities [] module CeEdiThrow = diff --git a/tests/fsharp/Compiler/Language/ComputationExpressionTests.fs b/tests/fsharp/Compiler/Language/ComputationExpressionTests.fs index 857f8a18678..c75052380f3 100644 --- a/tests/fsharp/Compiler/Language/ComputationExpressionTests.fs +++ b/tests/fsharp/Compiler/Language/ComputationExpressionTests.fs @@ -1,13 +1,13 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities open FSharp.Compiler.SourceCodeServices [] module ComputationExpressionTests = - let ``complex CE with source member and applicatives`` ceUsage = + let ``complex CE with source member and applicatives`` ceUsage = sprintf """ module Code type ResultBuilder() = @@ -22,15 +22,15 @@ type ResultBuilder() = let result = ResultBuilder() -module Result = - let zip x1 x2 = +module Result = + let zip x1 x2 = match x1,x2 with | Ok x1res, Ok x2res -> Ok (x1res, x2res) | Error e, _ -> Error e | _, Error e -> Error e let ofChoice c = - match c with + match c with | Choice1Of2 x -> Ok x | Choice2Of2 x -> Error x @@ -49,7 +49,7 @@ module Async = return r1,r2 } -module AsyncResult = +module AsyncResult = let zip x1 x2 = Async.zip x1 x2 |> Async.map(fun (r1, r2) -> Result.zip r1 r2) @@ -103,7 +103,7 @@ type AsyncResultBuilder() = compensation: unit -> unit) : Async> = async.TryFinally(computation, compensation) - + member __.Using (resource: 'T when 'T :> System.IDisposable, binder: 'T -> Async>) @@ -124,9 +124,9 @@ type AsyncResultBuilder() = this.Delay(fun () -> binder enum.Current))) member inline __.BindReturn(x: Async>, f) = async.Bind(x, fun r -> Result.map f r |> async.Return) - member inline __.MergeSources(t1: Async>, t2: Async>) = + member inline __.MergeSources(t1: Async>, t2: Async>) = AsyncResult.zip t1 t2 - + member inline _.Source(result : Async>) : Async> = result [] @@ -145,10 +145,10 @@ module ARExts = /// /// Method lets us transform data types into our internal representation. /// - member inline _.Source(choice : Choice<_,_>) : Async> = + member inline _.Source(choice : Choice<_,_>) : Async> = choice |> Result.ofChoice - |> Async.singleton + |> Async.singleton /// /// Method lets us transform data types into our internal representation. @@ -174,7 +174,7 @@ asyncResult { |> printfn "%d" """ CompilerAssert.Pass code - + [] let ``match-bang should apply source transformations to its inputs`` () = let code = ``complex CE with source member and applicatives`` """ diff --git a/tests/fsharp/Compiler/Libraries/Core/LanguagePrimitives/ComparisonTests.fs b/tests/fsharp/Compiler/Libraries/Core/LanguagePrimitives/ComparisonTests.fs index aa3451de6ba..b6f471608e6 100644 --- a/tests/fsharp/Compiler/Libraries/Core/LanguagePrimitives/ComparisonTests.fs +++ b/tests/fsharp/Compiler/Libraries/Core/LanguagePrimitives/ComparisonTests.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities [] module ``Comparison Tests`` = diff --git a/tests/fsharp/Compiler/Libraries/Core/LanguagePrimitives/StringFormatTests.fs b/tests/fsharp/Compiler/Libraries/Core/LanguagePrimitives/StringFormatTests.fs index b655b26d039..a912ab35562 100644 --- a/tests/fsharp/Compiler/Libraries/Core/LanguagePrimitives/StringFormatTests.fs +++ b/tests/fsharp/Compiler/Libraries/Core/LanguagePrimitives/StringFormatTests.fs @@ -3,11 +3,11 @@ namespace FSharp.Compiler.UnitTests open NUnit.Framework -open FSharp.TestHelpers +open FSharp.Test.Utilities [] module ``String Format Tests`` = - + [] let ``sprintf with %d format specifier``() = // Regression test for FSHARP1.0:4120 From 5742eefb2f4642bf77332c069cfde279a8a3f0e7 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii <1260985+vzarytovskii@users.noreply.github.com> Date: Mon, 15 Jun 2020 13:31:26 +0200 Subject: [PATCH 10/15] Fixed paths if NUGET_PACKAGES is defined (do not apppend '.nuget/packages' to it for 2nd time). --- tests/FSharp.Test.Utilities/TestFramework.fs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index c96c6d80747..90a2e73b2ec 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -172,13 +172,13 @@ type FSLibPaths = { FSCOREDLLPATH : string } let getPackagesDir () = - let p = match Environment.GetEnvironmentVariable("NUGET_PACKAGES") with - | null -> - match Environment.GetEnvironmentVariable("USERPROFILE") with - | null -> Environment.GetEnvironmentVariable("HOME") - | p -> p - | path -> path - p ++ ".nuget" ++ "packages" + match Environment.GetEnvironmentVariable("NUGET_PACKAGES") with + | null -> + let path = match Environment.GetEnvironmentVariable("USERPROFILE") with + | null -> Environment.GetEnvironmentVariable("HOME") + | p -> p + path ++ ".nuget" ++ "packages" + | path -> path let requireFile dir path = // Linux filesystems are (in most cases) case-sensitive. From 9fea437becfb026f3cf963f58dbe0eb253521f8e Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii <1260985+vzarytovskii@users.noreply.github.com> Date: Mon, 15 Jun 2020 14:00:06 +0200 Subject: [PATCH 11/15] Fixed platform name 'windows'->'win' --- tests/FSharp.Test.Utilities/TestFramework.fs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index 90a2e73b2ec..1e7ca95979b 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -223,20 +223,20 @@ let config configurationName envVars = let requirePackage = requireFile packagesDir let requireArtifact = requireFile artifactsBinPath let CSC = requirePackage ("Microsoft.Net.Compilers" ++ "2.7.0" ++ "tools" ++ "csc.exe") - let ILDASM_EXE = if operatingSystem = "windows" then "ildasm.exe" else "ildasm" + let ILDASM_EXE = if operatingSystem = "win" then "ildasm.exe" else "ildasm" let ILDASM = requirePackage (("runtime." + operatingSystem + "-" + architectureMoniker + ".Microsoft.NETCore.ILDAsm") ++ coreClrRuntimePackageVersion ++ "runtimes" ++ (operatingSystem + "-" + architectureMoniker) ++ "native" ++ ILDASM_EXE) - let ILASM_EXE = if operatingSystem = "windows" then "ilasm.exe" else "ilasm" + let ILASM_EXE = if operatingSystem = "win" then "ilasm.exe" else "ilasm" let ILASM = requirePackage (("runtime." + operatingSystem + "-" + architectureMoniker + ".Microsoft.NETCore.ILAsm") ++ coreClrRuntimePackageVersion ++ "runtimes" ++ (operatingSystem + "-" + architectureMoniker) ++ "native" ++ ILASM_EXE) - let CORECLR_DLL = if operatingSystem = "windows" then "coreclr.dll" elif operatingSystem = "osx" then "libcoreclr.dylib" else "libcoreclr.so" + let CORECLR_DLL = if operatingSystem = "win" then "coreclr.dll" elif operatingSystem = "osx" then "libcoreclr.dylib" else "libcoreclr.so" let coreclrdll = requirePackage (("runtime." + operatingSystem + "-" + architectureMoniker + ".Microsoft.NETCore.Runtime.CoreCLR") ++ coreClrRuntimePackageVersion ++ "runtimes" ++ (operatingSystem + "-" + architectureMoniker) ++ "native" ++ CORECLR_DLL) - let PEVERIFY_EXE = if operatingSystem = "windows" then "PEVerify.exe" else "PEVerify" + let PEVERIFY_EXE = if operatingSystem = "win" then "PEVerify.exe" else "PEVerify" let PEVERIFY = requireArtifact ("PEVerify" ++ configurationName ++ peverifyArchitecture ++ PEVERIFY_EXE) let FSharpBuild = requireArtifact ("FSharp.Build" ++ configurationName ++ fsharpBuildArchitecture ++ "FSharp.Build.dll") let FSharpCompilerInteractiveSettings = requireArtifact ("FSharp.Compiler.Interactive.Settings" ++ configurationName ++ fsharpCompilerInteractiveSettingsArchitecture ++ "FSharp.Compiler.Interactive.Settings.dll") let dotNetExe = // first look for {repoRoot}\.dotnet\dotnet.exe, otherwise fallback to %PATH% - let DOTNET_EXE = if operatingSystem = "windows" then "dotnet.exe" else "dotnet" + let DOTNET_EXE = if operatingSystem = "win" then "dotnet.exe" else "dotnet" let repoLocalDotnetPath = repoRoot ++ ".dotnet" ++ DOTNET_EXE if File.Exists(repoLocalDotnetPath) then repoLocalDotnetPath else DOTNET_EXE From 5e769fe2d782108e2eb6f72cc919046cd73a3bdf Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii <1260985+vzarytovskii@users.noreply.github.com> Date: Mon, 15 Jun 2020 15:47:33 +0200 Subject: [PATCH 12/15] Fixed path to FSI for scripts tests --- tests/FSharp.Test.Utilities/TestFramework.fs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index 1e7ca95979b..ac944b82152 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -245,8 +245,9 @@ let config configurationName envVars = File.Copy(coreclrdll, Path.GetDirectoryName(ILDASM) ++ CORECLR_DLL, overwrite=true) File.Copy(coreclrdll, Path.GetDirectoryName(ILASM) ++ CORECLR_DLL, overwrite=true) - let FSI_FOR_SCRIPTS = ("fsi" ++ configurationName ++ fsiArchitecture ++ "fsi.exe") - let FSI = requireArtifact FSI_FOR_SCRIPTS + let FSI_PATH = ("fsi" ++ configurationName ++ fsiArchitecture ++ "fsi.exe") + let FSI_FOR_SCRIPTS = requireArtifact FSI_PATH + let FSI = requireArtifact FSI_PATH #if !NETCOREAPP let FSIANYCPU = requireArtifact ("fsiAnyCpu" ++ configurationName ++ "net472" ++ "fsiAnyCpu.exe") #endif @@ -273,7 +274,7 @@ let config configurationName envVars = FSIANYCPU = FSIANYCPU #endif FSI_FOR_SCRIPTS = FSI_FOR_SCRIPTS - FSharpBuild = FSharpBuild + SharpBuild = FSharpBuild FSharpCompilerInteractiveSettings = FSharpCompilerInteractiveSettings csc_flags = csc_flags fsc_flags = fsc_flags @@ -296,6 +297,7 @@ let logConfig (cfg: TestConfig) = #if !NETCOREAPP log "FSIANYCPU =%s" cfg.FSIANYCPU #endif + log "FSI_FOR_SCRIPTS =%s" cfg.FSI_FOR_SCRIPTS log "fsi_flags =%s" cfg.fsi_flags log "ILDASM =%s" cfg.ILDASM log "PEVERIFY =%s" cfg.PEVERIFY From c88721a5ddd2590b69afc75f31edc002c80fdd0d Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii <1260985+vzarytovskii@users.noreply.github.com> Date: Mon, 15 Jun 2020 15:55:43 +0200 Subject: [PATCH 13/15] Revert acccidental typo --- tests/FSharp.Test.Utilities/TestFramework.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index ac944b82152..e28c04f5f95 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -274,7 +274,7 @@ let config configurationName envVars = FSIANYCPU = FSIANYCPU #endif FSI_FOR_SCRIPTS = FSI_FOR_SCRIPTS - SharpBuild = FSharpBuild + FSharpBuild = FSharpBuild FSharpCompilerInteractiveSettings = FSharpCompilerInteractiveSettings csc_flags = csc_flags fsc_flags = fsc_flags From be78be4c3273444d92bedccdea05092b17e32965 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii <1260985+vzarytovskii@users.noreply.github.com> Date: Tue, 16 Jun 2020 11:19:00 +0200 Subject: [PATCH 14/15] Use netcoreapp3.1 in tests as well --- tests/FSharp.Test.Utilities/Utilities.fs | 22 +-- tests/fsharp/Compiler/Language/ByrefTests.fs | 2 +- .../Language/DefaultInterfaceMemberTests.fs | 148 +++++++++--------- 3 files changed, 86 insertions(+), 86 deletions(-) diff --git a/tests/FSharp.Test.Utilities/Utilities.fs b/tests/FSharp.Test.Utilities/Utilities.fs index f55d1936b5c..4e014321697 100644 --- a/tests/FSharp.Test.Utilities/Utilities.fs +++ b/tests/FSharp.Test.Utilities/Utilities.fs @@ -17,7 +17,7 @@ module Utilities = [] type TargetFramework = | NetStandard20 - | NetCoreApp30 + | NetCoreApp31 module private TestReferences = @@ -30,13 +30,13 @@ module Utilities = let systemDynamicRuntimeRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netstandard20.System_Dynamic_Runtime).GetReference(display = "System.Dynamic.Runtime.dll (netstandard 2.0 ref)") [] - module NetCoreApp30 = - let netStandard = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp30.netstandard).GetReference(display = "netstandard.dll (netcoreapp 3.0 ref)") - let mscorlibRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp30.mscorlib).GetReference(display = "mscorlib.dll (netcoreapp 3.0 ref)") - let systemRuntimeRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp30.System_Runtime).GetReference(display = "System.Runtime.dll (netcoreapp 3.0 ref)") - let systemCoreRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp30.System_Core).GetReference(display = "System.Core.dll (netcoreapp 3.0 ref)") - let systemDynamicRuntimeRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp30.System_Dynamic_Runtime).GetReference(display = "System.Dynamic.Runtime.dll (netcoreapp 3.0 ref)") - let systemConsoleRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp30.System_Console).GetReference(display = "System.Console.dll (netcoreapp 3.0 ref)") + module NetCoreApp31 = + let netStandard = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp31.netstandard).GetReference(display = "netstandard.dll (netcoreapp 3.1 ref)") + let mscorlibRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp31.mscorlib).GetReference(display = "mscorlib.dll (netcoreapp 3.1 ref)") + let systemRuntimeRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp31.System_Runtime).GetReference(display = "System.Runtime.dll (netcoreapp 3.1 ref)") + let systemCoreRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp31.System_Core).GetReference(display = "System.Core.dll (netcoreapp 3.1 ref)") + let systemDynamicRuntimeRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp31.System_Dynamic_Runtime).GetReference(display = "System.Dynamic.Runtime.dll (netcoreapp 3.1 ref)") + let systemConsoleRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp31.System_Console).GetReference(display = "System.Console.dll (netcoreapp 3.1 ref)") [] module private TargetFrameworkUtil = @@ -45,13 +45,13 @@ module Utilities = let private netStandard20References = lazy ImmutableArray.Create(NetStandard20.netStandard.Value, NetStandard20.mscorlibRef.Value, NetStandard20.systemRuntimeRef.Value, NetStandard20.systemCoreRef.Value, NetStandard20.systemDynamicRuntimeRef.Value) - let private netCoreApp30References = - lazy ImmutableArray.Create(NetCoreApp30.netStandard.Value, NetCoreApp30.mscorlibRef.Value, NetCoreApp30.systemRuntimeRef.Value, NetCoreApp30.systemCoreRef.Value, NetCoreApp30.systemDynamicRuntimeRef.Value, NetCoreApp30.systemConsoleRef.Value) + let private netCoreApp31References = + lazy ImmutableArray.Create(NetCoreApp31.netStandard.Value, NetCoreApp31.mscorlibRef.Value, NetCoreApp31.systemRuntimeRef.Value, NetCoreApp31.systemCoreRef.Value, NetCoreApp31.systemDynamicRuntimeRef.Value, NetCoreApp31.systemConsoleRef.Value) let internal getReferences tf = match tf with | TargetFramework.NetStandard20 -> netStandard20References.Value - | TargetFramework.NetCoreApp30 -> netCoreApp30References.Value + | TargetFramework.NetCoreApp31 -> netCoreApp31References.Value type RoslynLanguageVersion = LanguageVersion diff --git a/tests/fsharp/Compiler/Language/ByrefTests.fs b/tests/fsharp/Compiler/Language/ByrefTests.fs index 92a45f3a0b5..69654175852 100644 --- a/tests/fsharp/Compiler/Language/ByrefTests.fs +++ b/tests/fsharp/Compiler/Language/ByrefTests.fs @@ -229,7 +229,7 @@ type MyClass() = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(cs, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(cs, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = diff --git a/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs b/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs index fbd968178f1..80cb1bf3174 100644 --- a/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs +++ b/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs @@ -129,7 +129,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -169,7 +169,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -217,7 +217,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -259,7 +259,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -308,7 +308,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -356,7 +356,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -406,7 +406,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -457,7 +457,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -494,7 +494,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -531,7 +531,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -572,7 +572,7 @@ let f1 () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -622,7 +622,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -677,7 +677,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -758,7 +758,7 @@ let main _ = // Explicitly implementing a protected DIM is allowed in F# 4.6. let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -857,7 +857,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -933,7 +933,7 @@ type Test2 () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1071,7 +1071,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1121,7 +1121,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1171,7 +1171,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1221,7 +1221,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1295,7 +1295,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1358,7 +1358,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1433,7 +1433,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1513,7 +1513,7 @@ type Test2 () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1566,7 +1566,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1615,7 +1615,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1665,7 +1665,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1722,7 +1722,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1761,7 +1761,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1804,7 +1804,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1843,7 +1843,7 @@ let test = { new ITest } """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1898,7 +1898,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -1946,7 +1946,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2006,7 +2006,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2074,7 +2074,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2157,7 +2157,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2235,7 +2235,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2313,7 +2313,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2385,7 +2385,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2451,7 +2451,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2540,7 +2540,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2610,7 +2610,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2689,7 +2689,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2751,7 +2751,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2840,7 +2840,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -2965,7 +2965,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -3076,7 +3076,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -3188,7 +3188,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -3304,7 +3304,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -3410,7 +3410,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -3513,7 +3513,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -3612,7 +3612,7 @@ type Test2 () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -3659,7 +3659,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -3706,7 +3706,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -3769,7 +3769,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -3836,7 +3836,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -3884,7 +3884,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -3939,7 +3939,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4004,7 +4004,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4094,7 +4094,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4172,7 +4172,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4269,7 +4269,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4364,7 +4364,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4451,7 +4451,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4501,7 +4501,7 @@ let test = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4564,7 +4564,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4620,7 +4620,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4684,7 +4684,7 @@ f () """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4744,7 +4744,7 @@ f3 () """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4789,7 +4789,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4839,7 +4839,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4889,7 +4889,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -4942,7 +4942,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = @@ -5038,7 +5038,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) |> CompilationReference.Create let fsCmpl = From 2538d20d4e48fe848bba8cf2a9f581a183c3660b Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii <1260985+vzarytovskii@users.noreply.github.com> Date: Tue, 16 Jun 2020 11:34:16 +0200 Subject: [PATCH 15/15] Revert "Use netcoreapp3.1 in tests as well" This reverts commit be78be4c3273444d92bedccdea05092b17e32965. --- tests/FSharp.Test.Utilities/Utilities.fs | 22 +-- tests/fsharp/Compiler/Language/ByrefTests.fs | 2 +- .../Language/DefaultInterfaceMemberTests.fs | 148 +++++++++--------- 3 files changed, 86 insertions(+), 86 deletions(-) diff --git a/tests/FSharp.Test.Utilities/Utilities.fs b/tests/FSharp.Test.Utilities/Utilities.fs index 4e014321697..f55d1936b5c 100644 --- a/tests/FSharp.Test.Utilities/Utilities.fs +++ b/tests/FSharp.Test.Utilities/Utilities.fs @@ -17,7 +17,7 @@ module Utilities = [] type TargetFramework = | NetStandard20 - | NetCoreApp31 + | NetCoreApp30 module private TestReferences = @@ -30,13 +30,13 @@ module Utilities = let systemDynamicRuntimeRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netstandard20.System_Dynamic_Runtime).GetReference(display = "System.Dynamic.Runtime.dll (netstandard 2.0 ref)") [] - module NetCoreApp31 = - let netStandard = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp31.netstandard).GetReference(display = "netstandard.dll (netcoreapp 3.1 ref)") - let mscorlibRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp31.mscorlib).GetReference(display = "mscorlib.dll (netcoreapp 3.1 ref)") - let systemRuntimeRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp31.System_Runtime).GetReference(display = "System.Runtime.dll (netcoreapp 3.1 ref)") - let systemCoreRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp31.System_Core).GetReference(display = "System.Core.dll (netcoreapp 3.1 ref)") - let systemDynamicRuntimeRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp31.System_Dynamic_Runtime).GetReference(display = "System.Dynamic.Runtime.dll (netcoreapp 3.1 ref)") - let systemConsoleRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp31.System_Console).GetReference(display = "System.Console.dll (netcoreapp 3.1 ref)") + module NetCoreApp30 = + let netStandard = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp30.netstandard).GetReference(display = "netstandard.dll (netcoreapp 3.0 ref)") + let mscorlibRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp30.mscorlib).GetReference(display = "mscorlib.dll (netcoreapp 3.0 ref)") + let systemRuntimeRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp30.System_Runtime).GetReference(display = "System.Runtime.dll (netcoreapp 3.0 ref)") + let systemCoreRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp30.System_Core).GetReference(display = "System.Core.dll (netcoreapp 3.0 ref)") + let systemDynamicRuntimeRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp30.System_Dynamic_Runtime).GetReference(display = "System.Dynamic.Runtime.dll (netcoreapp 3.0 ref)") + let systemConsoleRef = lazy AssemblyMetadata.CreateFromImage(TestResources.NetFX.netcoreapp30.System_Console).GetReference(display = "System.Console.dll (netcoreapp 3.0 ref)") [] module private TargetFrameworkUtil = @@ -45,13 +45,13 @@ module Utilities = let private netStandard20References = lazy ImmutableArray.Create(NetStandard20.netStandard.Value, NetStandard20.mscorlibRef.Value, NetStandard20.systemRuntimeRef.Value, NetStandard20.systemCoreRef.Value, NetStandard20.systemDynamicRuntimeRef.Value) - let private netCoreApp31References = - lazy ImmutableArray.Create(NetCoreApp31.netStandard.Value, NetCoreApp31.mscorlibRef.Value, NetCoreApp31.systemRuntimeRef.Value, NetCoreApp31.systemCoreRef.Value, NetCoreApp31.systemDynamicRuntimeRef.Value, NetCoreApp31.systemConsoleRef.Value) + let private netCoreApp30References = + lazy ImmutableArray.Create(NetCoreApp30.netStandard.Value, NetCoreApp30.mscorlibRef.Value, NetCoreApp30.systemRuntimeRef.Value, NetCoreApp30.systemCoreRef.Value, NetCoreApp30.systemDynamicRuntimeRef.Value, NetCoreApp30.systemConsoleRef.Value) let internal getReferences tf = match tf with | TargetFramework.NetStandard20 -> netStandard20References.Value - | TargetFramework.NetCoreApp31 -> netCoreApp31References.Value + | TargetFramework.NetCoreApp30 -> netCoreApp30References.Value type RoslynLanguageVersion = LanguageVersion diff --git a/tests/fsharp/Compiler/Language/ByrefTests.fs b/tests/fsharp/Compiler/Language/ByrefTests.fs index 69654175852..92a45f3a0b5 100644 --- a/tests/fsharp/Compiler/Language/ByrefTests.fs +++ b/tests/fsharp/Compiler/Language/ByrefTests.fs @@ -229,7 +229,7 @@ type MyClass() = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(cs, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(cs, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = diff --git a/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs b/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs index 80cb1bf3174..fbd968178f1 100644 --- a/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs +++ b/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs @@ -129,7 +129,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -169,7 +169,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -217,7 +217,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -259,7 +259,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -308,7 +308,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -356,7 +356,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -406,7 +406,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -457,7 +457,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -494,7 +494,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -531,7 +531,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -572,7 +572,7 @@ let f1 () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -622,7 +622,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -677,7 +677,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -758,7 +758,7 @@ let main _ = // Explicitly implementing a protected DIM is allowed in F# 4.6. let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -857,7 +857,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -933,7 +933,7 @@ type Test2 () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1071,7 +1071,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1121,7 +1121,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1171,7 +1171,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1221,7 +1221,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1295,7 +1295,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1358,7 +1358,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1433,7 +1433,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1513,7 +1513,7 @@ type Test2 () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1566,7 +1566,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1615,7 +1615,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1665,7 +1665,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1722,7 +1722,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1761,7 +1761,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1804,7 +1804,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1843,7 +1843,7 @@ let test = { new ITest } """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1898,7 +1898,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -1946,7 +1946,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2006,7 +2006,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2074,7 +2074,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2157,7 +2157,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2235,7 +2235,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2313,7 +2313,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2385,7 +2385,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2451,7 +2451,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2540,7 +2540,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2610,7 +2610,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2689,7 +2689,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2751,7 +2751,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2840,7 +2840,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -2965,7 +2965,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -3076,7 +3076,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -3188,7 +3188,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -3304,7 +3304,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -3410,7 +3410,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -3513,7 +3513,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -3612,7 +3612,7 @@ type Test2 () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -3659,7 +3659,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -3706,7 +3706,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -3769,7 +3769,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -3836,7 +3836,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -3884,7 +3884,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -3939,7 +3939,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4004,7 +4004,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4094,7 +4094,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4172,7 +4172,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4269,7 +4269,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4364,7 +4364,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4451,7 +4451,7 @@ type Test () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4501,7 +4501,7 @@ let test = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4564,7 +4564,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4620,7 +4620,7 @@ let main _ = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4684,7 +4684,7 @@ f () """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4744,7 +4744,7 @@ f3 () """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4789,7 +4789,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4839,7 +4839,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4889,7 +4889,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -4942,7 +4942,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl = @@ -5038,7 +5038,7 @@ let f () = """ let csCmpl = - CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31) + CompilationUtil.CreateCSharpCompilation(csharpSource, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp30) |> CompilationReference.Create let fsCmpl =