Skip to content

Commit

Permalink
Add test case for .stan.toml configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
0rphee committed Jan 9, 2024
1 parent 750fca7 commit a5a706b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/hls-stan-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ tests =
assertBool "" $ T.isPrefixOf expectedPrefix (reduceDiag ^. L.message)
reduceDiag ^. L.source @?= Just "stan"
return ()
, testCase "ignores diagnostics from .stan.toml" $
runStanSession "" $ do
doc <- openDoc "dir/configTest.hs" "haskell"
diags <- waitForDiagnosticsFromSource doc "stan"
liftIO $ length diags @?= 0
return ()
]

testDir :: FilePath
Expand Down
14 changes: 14 additions & 0 deletions plugins/hls-stan-plugin/test/testdata/.stan.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[check]]
type = "Exclude"
id = "STAN-0206"
scope = "all"

[[check]]
type = "Exclude"
id = "STAN-0103"
file = "dir/configTest.hs"

[[check]]
type = "Exclude"
id = "STAN-0212"
directory = "dir/"
5 changes: 5 additions & 0 deletions plugins/hls-stan-plugin/test/testdata/dir/configTest.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data A = A Int Int

a = length [1..]

b = undefined

0 comments on commit a5a706b

Please sign in to comment.