Skip to content

Commit c5d000c

Browse files
committed
more tests
1 parent ab82999 commit c5d000c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/FSharpLint.Client.Tests/TestClient.fs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,17 @@ let ``Daemon can lint a file with success``() =
117117
| LintResult warnings ->
118118
Assert.IsNotEmpty warnings
119119
Assert.AreEqual(LanguagePrimitives.EnumToValue FSharpLintResponseCode.OkLint, versionResponse.Code)
120+
121+
[<Test>]
122+
let ``LintError if Daemon lint an unparsable file``() =
123+
using (new ToolLocationOverride(ToolStatus.Available)) <| fun _ ->
124+
125+
let testHintsFile = basePath </> "tests" </> "FSharpLint.Client.Tests" </> "UnparsableFile.fs"
126+
let fsharpLintService: FSharpLintService = new LSPFSharpLintService() :> FSharpLintService
127+
let versionResponse = runLintFileCall testHintsFile fsharpLintService
128+
129+
match versionResponse.Result with
130+
| Content result -> Assert.Fail("Should be a lint result")
131+
| LintResult warnings ->
132+
Assert.AreEqual(LanguagePrimitives.EnumToValue FSharpLintResponseCode.OkLintError, versionResponse.Code)
133+
Assert.IsEmpty warnings
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Test
2+
3+
# Hello word
4+
5+
## I'm a markdown (probably ?)
6+
let test = System.IO.Fi le

0 commit comments

Comments
 (0)