Add test for no errors case

This commit is contained in:
Kohei Suzuki 2014-05-11 00:25:44 +09:00
parent d88dcde733
commit bcd2dfcffc
2 changed files with 11 additions and 0 deletions

View File

@ -34,3 +34,10 @@ spec = do
cradle <- findCradleWithoutSandbox
res <- checkSyntax defaultOptions cradle ["Baz.hs"]
res `shouldSatisfy` ("Baz.hs:5:1:Warning:" `isPrefixOf`)
context "without errors" $ do
it "doesn't output empty line" $ do
withDirectory_ "test/data/ghc-mod-check/Data" $ do
cradle <- findCradleWithoutSandbox
res <- checkSyntax defaultOptions cradle ["Foo.hs"]
res `shouldBe` ""

View File

@ -10,3 +10,7 @@ spec = 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"
context "without suggestions" $ do
it "doesn't output empty line" $ do
res <- lintSyntax defaultOptions "test/data/ghc-mod-check/Data/Foo.hs"
res `shouldBe` ""