ghc-mod/test/LintSpec.hs

18 lines
614 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
import TestUtils
2013-02-12 05:31:01 +00:00
spec :: Spec
spec = do
describe "lint" $ do
it "can detect a redundant import" $ do
res <- runD $ lint "test/data/hlint.hs"
2013-02-12 05:31:01 +00:00
res `shouldBe` "test/data/hlint.hs:4:8: Error: Redundant do\NULFound:\NUL do putStrLn \"Hello, world!\"\NULWhy not:\NUL putStrLn \"Hello, world!\"\n"
context "when no suggestions are given" $ do
it "doesn't output an empty line" $ do
res <- runD $ lint "test/data/ghc-mod-check/Data/Foo.hs"
2014-05-10 15:25:44 +00:00
res `shouldBe` ""