Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Commit

Permalink
Add failing test for multiple module defitions error (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielG committed Jun 18, 2018
1 parent fea77f2 commit a9fdf46
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/FileMappingSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ spec = do
checkSyntax ["File.hs"]
res `shouldBe` "File.hs:1:1:Warning: Top-level binding with no type signature: main :: IO ()\n"

it "works in a project with multiple executables (multiple Main modules)" $ do
let fm = [ ("Main.hs", "Main_Redir.hs")
, ("OtherMain.hs", "OtherMain_Redir.hs")
]
res <- runD' "test/data/file-mapping/duplicate-main" $ do
mapM_ (uncurry loadMappedFile) fm
checkSyntax ["Main.hs"]
res `shouldBe` "" -- check it doesn't error

it "checks in-memory file if one is specified and outputs original filename" $ do
withDirectory_ "test/data/file-mapping" $ do
let fm = [("File.hs", "main = putStrLn \"Hello World!\"\n")]
Expand Down

0 comments on commit a9fdf46

Please sign in to comment.