Skip to content

Commit 1116c31

Browse files
committed
add integration test for unsupported cabal version
Signed-off-by: Julian Kalema Lukwata <julianlukwata@posteo.de>
1 parent cb4c4af commit 1116c31

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

plugins/hls-cabal-plugin/test/Main.hs

+8
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ pluginTests =
107107
length diags @?= 1
108108
unknownLicenseDiag ^. L.range @?= Range (Position 3 24) (Position 4 0)
109109
unknownLicenseDiag ^. L.severity @?= Just DiagnosticSeverity_Error
110+
, runCabalTestCaseSession "Publishes Diagnostics on Error in the first line" "" $ do
111+
_ <- openDoc "unsupportedVersion.cabal" "cabal"
112+
diags <- cabalCaptureKick
113+
unknownVersionDiag <- liftIO $ inspectDiagnostic diags ["Unsupported cabal-version 99999.0"]
114+
liftIO $ do
115+
length diags @?= 1
116+
unknownVersionDiag ^. L.range @?= Range (Position 0 0) (Position 1 0)
117+
unknownVersionDiag ^. L.severity @?= Just DiagnosticSeverity_Error
110118
, runCabalTestCaseSession "Clears diagnostics" "" $ do
111119
doc <- openDoc "invalid.cabal" "cabal"
112120
diags <- cabalCaptureKick
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cabal-version: 99999.0
2+
name: invalid
3+
version: 0.1.0.0

0 commit comments

Comments
 (0)