Skip to content

Commit 3ce8eb1

Browse files
sergey-tihoncartermp
authored andcommitted
Moved Don't Suggest Tests over to NUnit (#7288)
1 parent 8370ef6 commit 3ce8eb1

6 files changed

Lines changed: 49 additions & 31 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
2+
3+
namespace FSharp.Compiler.UnitTests
4+
5+
open NUnit.Framework
6+
open FSharp.Compiler.SourceCodeServices
7+
8+
[<TestFixture>]
9+
module ``Don't Suggest`` =
10+
11+
[<Test>]
12+
let ``Dont Suggest Completely Wrong Stuff``() =
13+
CompilerAssert.TypeCheckSingleError
14+
"""
15+
let _ = Path.GetFullPath "images"
16+
"""
17+
FSharpErrorSeverity.Error
18+
39
19+
(2, 9, 2, 13)
20+
"The value, namespace, type or module 'Path' is not defined."
21+
22+
[<Test>]
23+
let ``Dont Suggest When Things Are Open``() =
24+
CompilerAssert.ParseWithErrors
25+
"""
26+
module N =
27+
let name = "hallo"
28+
29+
type T =
30+
static member myMember = 1
31+
32+
let x = N.
33+
"""
34+
[|
35+
FSharpErrorSeverity.Error, 599, (8, 10, 8, 11), "Missing qualification after '.'"
36+
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."
37+
|]
38+
39+
[<Test>]
40+
let ``Dont Suggest Intentionally Unused Variables``() =
41+
CompilerAssert.TypeCheckSingleError
42+
"""
43+
let hober xy _xyz = xyz
44+
"""
45+
FSharpErrorSeverity.Error
46+
39
47+
(2, 21, 2, 24)
48+
"The value or constructor 'xyz' is not defined."

tests/fsharp/FSharpSuite.Tests.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<Compile Include="Compiler\ErrorMessages\UpcastDowncastTests.fs" />
4747
<Compile Include="Compiler\ErrorMessages\AssignmentErrorTests.fs" />
4848
<Compile Include="Compiler\ErrorMessages\WarnExpressionTests.fs" />
49+
<Compile Include="Compiler\ErrorMessages\DontSuggestTests.fs" />
4950
<Compile Include="Compiler\SourceTextTests.fs" />
5051
<Compile Include="Compiler\Language\AnonRecordTests.fs" />
5152
<Compile Include="Compiler\Language\SpanOptimizationTests.fs" />

tests/fsharpqa/Source/Warnings/DontSuggestCompletelyWrongStuff.fs

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/fsharpqa/Source/Warnings/DontSuggestIntentionallyUnusedVariables.fs

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/fsharpqa/Source/Warnings/DontSuggestWhenThingsAreOpen.fs

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/fsharpqa/Source/Warnings/env.lst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616
SOURCE=SuggestUnionCases.fs SCFLAGS="--vserrors" # SuggestUnionCases.fs
1717
SOURCE=SuggestArrayModuleFunctions.fs SCFLAGS="--vserrors" # SuggestArrayModuleFunctions.fs
1818
SOURCE=SuggestTypesInNamespace.fs # SuggestTypesInNamespace.fs
19-
SOURCE=DontSuggestCompletelyWrongStuff.fs SCFLAGS="--vserrors" # DontSuggestCompletelyWrongStuff.fs
2019
SOURCE=SuggestTypesInNamespaceVS.fs SCFLAGS="--vserrors" # SuggestTypesInNamespaceVS.fs
2120
SOURCE=SuggestAsyncModule.fs SCFLAGS="--vserrors" # SuggestAsyncModule.fs
22-
SOURCE=DontSuggestWhenThingsAreOpen.fs SCFLAGS="--vserrors" # DontSuggestWhenThingsAreOpen.fs
2321
SOURCE=SuggestDoubleBacktickIdentifiers.fs SCFLAGS="--vserrors" # SuggestDoubleBacktickIdentifiers.fs
2422
SOURCE=SuggestDoubleBacktickUnions.fs SCFLAGS="--vserrors" # SuggestDoubleBacktickUnions.fs
2523
SOURCE=MissingExpressionAfterLet.fs # MissingExpressionAfterLet.fs
@@ -28,4 +26,3 @@
2826
SOURCE=SuggestToUseIndexer.fs # SuggestToUseIndexer.fs
2927
SOURCE=Repro1548.fs SCFLAGS="-r:Repro1548.dll" # Repro1548.fs
3028
SOURCE=ModuleAbbreviationsArePrivate.fs
31-
SOURCE=DontSuggestIntentionallyUnusedVariables.fs SCFLAGS="--vserrors" # DontSuggestIntentionallyUnusedVariables.fs

0 commit comments

Comments
 (0)