Moved Don't Suggest Tests over to NUnit (#7288)

This commit is contained in:
Sergey Tihon 2019-07-29 06:34:39 +03:00 коммит произвёл Phillip Carter
Родитель 8370ef62eb
Коммит 3ce8eb1b2a
6 изменённых файлов: 49 добавлений и 31 удалений

Просмотреть файл

@ -0,0 +1,48 @@
// 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 FSharp.Compiler.SourceCodeServices
[<TestFixture>]
module ``Don't Suggest`` =
[<Test>]
let ``Dont Suggest Completely Wrong Stuff``() =
CompilerAssert.TypeCheckSingleError
"""
let _ = Path.GetFullPath "images"
"""
FSharpErrorSeverity.Error
39
(2, 9, 2, 13)
"The value, namespace, type or module 'Path' is not defined."
[<Test>]
let ``Dont Suggest When Things Are Open``() =
CompilerAssert.ParseWithErrors
"""
module N =
let name = "hallo"
type T =
static member myMember = 1
let x = N.
"""
[|
FSharpErrorSeverity.Error, 599, (8, 10, 8, 11), "Missing qualification after '.'"
FSharpErrorSeverity.Error, 222, (2, 1, 3, 1), "Files in libraries or multiple-file applications must begin with a namespace or module declaration. When using a module declaration at the start of a file the '=' sign is not allowed. If this is a top-level module, consider removing the = to resolve this error."
|]
[<Test>]
let ``Dont Suggest Intentionally Unused Variables``() =
CompilerAssert.TypeCheckSingleError
"""
let hober xy _xyz = xyz
"""
FSharpErrorSeverity.Error
39
(2, 21, 2, 24)
"The value or constructor 'xyz' is not defined."

Просмотреть файл

@ -46,6 +46,7 @@
<Compile Include="Compiler\ErrorMessages\UpcastDowncastTests.fs" />
<Compile Include="Compiler\ErrorMessages\AssignmentErrorTests.fs" />
<Compile Include="Compiler\ErrorMessages\WarnExpressionTests.fs" />
<Compile Include="Compiler\ErrorMessages\DontSuggestTests.fs" />
<Compile Include="Compiler\SourceTextTests.fs" />
<Compile Include="Compiler\Language\AnonRecordTests.fs" />
<Compile Include="Compiler\Language\SpanOptimizationTests.fs" />

Просмотреть файл

@ -1,7 +0,0 @@
// #Warnings
//<Expects status="Error" id="FS0039">The value, namespace, type or module 'Path' is not defined.</Expects>
//<Expects>Maybe you want one of the following:\s+Math</Expects>
let _ = Path.GetFullPath "images"
exit 0

Просмотреть файл

@ -1,8 +0,0 @@
//<Expects status="Error" id="FS0039">The value or constructor 'xyz' is not defined.</Expects>
//<Expects>Maybe you want one of the following:</Expects>
//<Expects>\s+xy</Expects>
//<Expects status="notin">\s+_xyz</Expects>
let hober xy _xyz = xyz
exit 0

Просмотреть файл

@ -1,13 +0,0 @@
// #Warnings
//<Expects status="Error" id="FS0599">Missing qualification after '.'</Expects>
module N =
let name = "hallo"
type T =
static member myMember = 1
let x = N.
exit 0

Просмотреть файл

@ -16,10 +16,8 @@
SOURCE=SuggestUnionCases.fs SCFLAGS="--vserrors" # SuggestUnionCases.fs
SOURCE=SuggestArrayModuleFunctions.fs SCFLAGS="--vserrors" # SuggestArrayModuleFunctions.fs
SOURCE=SuggestTypesInNamespace.fs # SuggestTypesInNamespace.fs
SOURCE=DontSuggestCompletelyWrongStuff.fs SCFLAGS="--vserrors" # DontSuggestCompletelyWrongStuff.fs
SOURCE=SuggestTypesInNamespaceVS.fs SCFLAGS="--vserrors" # SuggestTypesInNamespaceVS.fs
SOURCE=SuggestAsyncModule.fs SCFLAGS="--vserrors" # SuggestAsyncModule.fs
SOURCE=DontSuggestWhenThingsAreOpen.fs SCFLAGS="--vserrors" # DontSuggestWhenThingsAreOpen.fs
SOURCE=SuggestDoubleBacktickIdentifiers.fs SCFLAGS="--vserrors" # SuggestDoubleBacktickIdentifiers.fs
SOURCE=SuggestDoubleBacktickUnions.fs SCFLAGS="--vserrors" # SuggestDoubleBacktickUnions.fs
SOURCE=MissingExpressionAfterLet.fs # MissingExpressionAfterLet.fs
@ -28,4 +26,3 @@
SOURCE=SuggestToUseIndexer.fs # SuggestToUseIndexer.fs
SOURCE=Repro1548.fs SCFLAGS="-r:Repro1548.dll" # Repro1548.fs
SOURCE=ModuleAbbreviationsArePrivate.fs
SOURCE=DontSuggestIntentionallyUnusedVariables.fs SCFLAGS="--vserrors" # DontSuggestIntentionallyUnusedVariables.fs