Fix session caching, #807
also: - cleanup LightGhc - make the new DynFlags to compare against in a clean HscEnv
This commit is contained in:
@@ -22,20 +22,20 @@ spec = do
|
||||
runLightGhc env (return ()) `shouldReturn` ()
|
||||
|
||||
it "has modules in scope" $ do
|
||||
withLightHscEnv [] $ \env ->
|
||||
(withLightHscEnv [] $ \env ->
|
||||
runLightGhc env $ do
|
||||
dflags <- getSessionDynFlags
|
||||
let i = intersect (listVisibleModuleNames dflags)
|
||||
["Control.Applicative", "Control.Arrow"
|
||||
,"Control.Exception", "GHC.Exts", "GHC.Float"]
|
||||
liftIO $ i `shouldSatisfy` not . null
|
||||
liftIO $ i `shouldSatisfy` not . null) :: IO ()
|
||||
|
||||
it "can get module info" $ do
|
||||
withLightHscEnv [] $ \env ->
|
||||
(withLightHscEnv [] $ \env ->
|
||||
runLightGhc env $ do
|
||||
mdl <- findModule "Data.List" Nothing
|
||||
mmi <- getModuleInfo mdl
|
||||
liftIO $ isJust mmi `shouldBe` True
|
||||
liftIO $ isJust mmi `shouldBe` True) :: IO ()
|
||||
|
||||
|
||||
describe "resolveModule" $ do
|
||||
|
||||
Reference in New Issue
Block a user