diff --git a/ghc-mod.cabal b/ghc-mod.cabal index d16e984..9f1969e 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -70,6 +70,7 @@ Test-Suite spec BrowseSpec FlagSpec LangSpec + LintSpec ListSpec Build-Depends: base >= 4.0 && < 5 , Cabal >= 1.10 diff --git a/test/LintSpec.hs b/test/LintSpec.hs new file mode 100644 index 0000000..e4eaebb --- /dev/null +++ b/test/LintSpec.hs @@ -0,0 +1,13 @@ +module LintSpec where + +import Test.Hspec +import Lint +import Types + +spec :: Spec +spec = do + describe "lintSyntax" $ do + it "check syntax with HList" $ do + res <- lintSyntax defaultOptions "test/data/hlint.hs" + res `shouldBe` "test/data/hlint.hs:4:8: Error: Redundant do\NULFound:\NUL do putStrLn \"Hello, world!\"\NULWhy not:\NUL putStrLn \"Hello, world!\"\n" + diff --git a/test/data/hlint.hs b/test/data/hlint.hs new file mode 100644 index 0000000..b721607 --- /dev/null +++ b/test/data/hlint.hs @@ -0,0 +1,5 @@ +module Hlist where + +main :: IO () +main = do + putStrLn "Hello, world!"