test for Lint.
This commit is contained in:
parent
d115c1dacb
commit
23045b5312
@ -70,6 +70,7 @@ Test-Suite spec
|
||||
BrowseSpec
|
||||
FlagSpec
|
||||
LangSpec
|
||||
LintSpec
|
||||
ListSpec
|
||||
Build-Depends: base >= 4.0 && < 5
|
||||
, Cabal >= 1.10
|
||||
|
13
test/LintSpec.hs
Normal file
13
test/LintSpec.hs
Normal file
@ -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"
|
||||
|
5
test/data/hlint.hs
Normal file
5
test/data/hlint.hs
Normal file
@ -0,0 +1,5 @@
|
||||
module Hlist where
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
putStrLn "Hello, world!"
|
Loading…
Reference in New Issue
Block a user