diff --git a/plugins/hls-stan-plugin/test/Main.hs b/plugins/hls-stan-plugin/test/Main.hs index 6f0a41ca9b..32cdd7c41e 100644 --- a/plugins/hls-stan-plugin/test/Main.hs +++ b/plugins/hls-stan-plugin/test/Main.hs @@ -44,13 +44,17 @@ tests = runStanSession "" $ do doc <- openDoc "extension-tests/language-pragma/LanguagePragmaTest.hs" "haskell" diags <- waitForDiagnosticsFromSource doc "stan" - liftIO $ length diags @?= 0 + -- We must include at least one valid diagnostic in our test file to avoid + -- the false-positive case where Stan finds no analyses to perform due to a + -- bad mapping, which would also lead to zero diagnostics being returned. + liftIO $ length diags @?= 1 return () , testCase "respects language extensions defined in the .cabal file" $ runStanSession "" $ do doc <- openDoc "extension-tests/cabal-file/CabalFileTest.hs" "haskell" diags <- waitForDiagnosticsFromSource doc "stan" - liftIO $ length diags @?= 0 + -- We need at least one valid diagnostic here too, for the same reason as above. + liftIO $ length diags @?= 1 return () ] diff --git a/plugins/hls-stan-plugin/test/testdata/extension-tests/cabal-file/CabalFileTest.hs b/plugins/hls-stan-plugin/test/testdata/extension-tests/cabal-file/CabalFileTest.hs index 71b4380104..77b6dc3845 100644 --- a/plugins/hls-stan-plugin/test/testdata/extension-tests/cabal-file/CabalFileTest.hs +++ b/plugins/hls-stan-plugin/test/testdata/extension-tests/cabal-file/CabalFileTest.hs @@ -2,3 +2,6 @@ module CabalFileTest () where -- With `StrictData` enabled in the `.cabal` file, Stan shouldn't complain here: data A = A Int Int + +-- ...but it should still complain here! +kewlFunc = undefined diff --git a/plugins/hls-stan-plugin/test/testdata/extension-tests/language-pragma/LanguagePragmaTest.hs b/plugins/hls-stan-plugin/test/testdata/extension-tests/language-pragma/LanguagePragmaTest.hs index 3da9a28254..6f5631ac8c 100644 --- a/plugins/hls-stan-plugin/test/testdata/extension-tests/language-pragma/LanguagePragmaTest.hs +++ b/plugins/hls-stan-plugin/test/testdata/extension-tests/language-pragma/LanguagePragmaTest.hs @@ -4,3 +4,6 @@ module LanguagePragmaTest () where -- With the above `StrictData` language pragma, Stan shouldn't complain here: data A = A Int Int + +-- ...but it should still complain here! +kewlFunc = undefined