File tree Expand file tree Collapse file tree 5 files changed +42
-0
lines changed
plugins/hls-stan-plugin/test Expand file tree Collapse file tree 5 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,18 @@ tests =
40
40
diags <- waitForDiagnosticsFromSource doc " stan"
41
41
liftIO $ length diags @?= 0
42
42
return ()
43
+ , testCase " respects LANGUAGE pragmas in the source file" $
44
+ runStanSession " " $ do
45
+ doc <- openDoc " extension-tests/language-pragma/LanguagePragmaTest.hs" " haskell"
46
+ diags <- waitForDiagnosticsFromSource doc " stan"
47
+ liftIO $ length diags @?= 0
48
+ return ()
49
+ , testCase " respects language extensions defined in the .cabal file" $
50
+ runStanSession " " $ do
51
+ doc <- openDoc " extension-tests/cabal-file/CabalFileTest.hs" " haskell"
52
+ diags <- waitForDiagnosticsFromSource doc " stan"
53
+ liftIO $ length diags @?= 0
54
+ return ()
43
55
]
44
56
45
57
testDir :: FilePath
Original file line number Diff line number Diff line change
1
+ module CabalFileTest () where
2
+
3
+ -- With `StrictData` enabled in the `.cabal` file, Stan shouldn't complain here:
4
+ data A = A Int Int
Original file line number Diff line number Diff line change
1
+ cabal-version : 3.0
2
+ name : cabal-file-test
3
+ version : 0.0.0.0
4
+
5
+ library
6
+ exposed-modules : CabalFileTest
7
+ hs-source-dirs : extension-tests/cabal-file
8
+ -- Specifically, we're testing that Stan respects the following extension definition:
9
+ default-extensions : StrictData
Original file line number Diff line number Diff line change
1
+ {-# LANGUAGE StrictData #-}
2
+
3
+ module LanguagePragmaTest () where
4
+
5
+ -- With the above `StrictData` language pragma, Stan shouldn't complain here:
6
+ data A = A Int Int
Original file line number Diff line number Diff line change
1
+ cabal-version : 3.0
2
+ name : language-pragma-test
3
+ version : 0.0.0.0
4
+
5
+ -- Without at least a minimal valid `.cabal` file, Stan won't bother building its
6
+ -- map of language extensions. This means it also won't detect LANGUAGE pragmas
7
+ -- without this file.
8
+
9
+ library
10
+ exposed-modules : LanguagePragmaTest
11
+ hs-source-dirs : extension-tests/language-pragma
You can’t perform that action at this time.
0 commit comments