summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-api/T9595.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2014-09-15 13:14:30 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2014-09-15 13:15:15 -0700
commitb72478f41b85337b84edab8f625d103e197f116c (patch)
treee0ab347d2885067bdf6a0964304f2e9f3cd9e4a9 /testsuite/tests/ghc-api/T9595.hs
parent65f887e1a0d864526f6a2609a3afc2c151c25e38 (diff)
downloadhaskell-b72478f41b85337b84edab8f625d103e197f116c.tar.gz
Don't offer hidden modules for autocomplete.
It was annoying to test GHCi directly, so I added a ghc-api unit test of the function instead. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'testsuite/tests/ghc-api/T9595.hs')
-rw-r--r--testsuite/tests/ghc-api/T9595.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-api/T9595.hs b/testsuite/tests/ghc-api/T9595.hs
new file mode 100644
index 0000000000..b6c336ab9a
--- /dev/null
+++ b/testsuite/tests/ghc-api/T9595.hs
@@ -0,0 +1,23 @@
+module Main where
+
+import GHC
+import Packages
+import GhcMonad
+import Outputable
+import System.Environment
+import DynFlags
+import Module
+
+main =
+ do [libdir] <- getArgs
+ _ <- runGhc (Just libdir) $ do
+ dflags <- getSessionDynFlags
+ setSessionDynFlags dflags
+ dflags <- getSessionDynFlags
+ liftIO $ print (mkModuleName "Outputable" `elem` listVisibleModuleNames dflags)
+ _ <- runGhc (Just libdir) $ do
+ dflags <- getSessionDynFlags
+ setSessionDynFlags (dflags { packageFlags = [ExposePackage (PackageArg "ghc") Nothing]})
+ dflags <- getSessionDynFlags
+ liftIO $ print (mkModuleName "Outputable" `elem` listVisibleModuleNames dflags)
+ return ()