Skip to content

Commit

Permalink
add integration test for unsupported cabal version
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Kalema Lukwata <[email protected]>
  • Loading branch information
fridewald committed Oct 12, 2024
1 parent cb4c4af commit 1116c31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/hls-cabal-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ pluginTests =
length diags @?= 1
unknownLicenseDiag ^. L.range @?= Range (Position 3 24) (Position 4 0)
unknownLicenseDiag ^. L.severity @?= Just DiagnosticSeverity_Error
, runCabalTestCaseSession "Publishes Diagnostics on Error in the first line" "" $ do
_ <- openDoc "unsupportedVersion.cabal" "cabal"
diags <- cabalCaptureKick
unknownVersionDiag <- liftIO $ inspectDiagnostic diags ["Unsupported cabal-version 99999.0"]
liftIO $ do
length diags @?= 1
unknownVersionDiag ^. L.range @?= Range (Position 0 0) (Position 1 0)
unknownVersionDiag ^. L.severity @?= Just DiagnosticSeverity_Error
, runCabalTestCaseSession "Clears diagnostics" "" $ do
doc <- openDoc "invalid.cabal" "cabal"
diags <- cabalCaptureKick
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cabal-version: 99999.0
name: invalid
version: 0.1.0.0

0 comments on commit 1116c31

Please sign in to comment.