Migrate the remaining parts of the exposed API to GhcMod a
This commit is contained in:
@@ -2,15 +2,16 @@ module LintSpec where
|
||||
|
||||
import Language.Haskell.GhcMod
|
||||
import Test.Hspec
|
||||
import TestUtils
|
||||
|
||||
spec :: Spec
|
||||
spec = do
|
||||
describe "lintSyntax" $ do
|
||||
it "check syntax with HLint" $ do
|
||||
res <- lintSyntax defaultOptions "test/data/hlint.hs"
|
||||
describe "lint" $ do
|
||||
it "can detect a redundant import" $ do
|
||||
res <- runD $ lint "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"
|
||||
|
||||
context "without suggestions" $ do
|
||||
it "doesn't output empty line" $ do
|
||||
res <- lintSyntax defaultOptions "test/data/ghc-mod-check/Data/Foo.hs"
|
||||
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"
|
||||
res `shouldBe` ""
|
||||
|
||||
Reference in New Issue
Block a user