Skip to content
Snippets Groups Projects
Commit b7ca94fd authored by Daniel Gröber (dxld)'s avatar Daniel Gröber (dxld) Committed by Marge Bot
Browse files

PartialDownsweep: Add test for import errors

parent 99e72769
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import GhcMake
import DynFlags
import Outputable
import Exception (ExceptionMonad, ghandle)
import Bag
import Control.Monad
import Control.Monad.IO.Class (liftIO)
......@@ -134,6 +135,17 @@ main = do
sort (map (moduleNameString . moduleName . ms_mod) mss) == ["A", "C"]
)
go "Import error"
[ [ "module A where"
, "import B"
, "import DoesNotExist_FooBarBaz"
]
, [ "module B where"
]
]
(\mss -> return $
sort (map (moduleNameString . moduleName . ms_mod) mss) == ["A", "B"]
)
errored <- readIORef any_failed
when errored $ exitFailure
......@@ -154,6 +166,7 @@ go label mods cnd =
hsc_env <- getSession
emss <- liftIO $ downsweep hsc_env [] [] False
-- liftIO $ hPutStrLn stderr $ showSDocUnsafe $ ppr $ rights emss
-- liftIO $ hPrint stderr $ bagToList $ unionManyBags $ lefts emss
it label $ cnd (rights emss)
......
......@@ -13,3 +13,4 @@ B.hs:2:0: error:
error: #elif without #if
#elif <- cpp error here
== Import error
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment