ghc-mod/test/LintSpec.hs

17 lines
612 B
Haskell
Raw Normal View History

2013-02-12 05:31:01 +00:00
module LintSpec where
2013-05-20 02:29:44 +00:00
import Language.Haskell.GhcMod
2013-02-12 05:31:01 +00:00
import Test.Hspec
spec :: Spec
spec = do
describe "lintSyntax" $ do
2014-03-13 00:34:45 +00:00
it "check syntax with HLint" $ do
2013-02-12 05:31:01 +00:00
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"
2014-05-10 15:25:44 +00:00
context "without suggestions" $ do
it "doesn't output empty line" $ do
res <- lintSyntax defaultOptions "test/data/ghc-mod-check/Data/Foo.hs"
res `shouldBe` ""