@@ -182,6 +182,30 @@ diagnosticTests = testGroup "diagnostics"
182 , [(DsWarning, (2, 0), "The import of 'ModuleA' is redundant")]
182 , [(DsWarning, (2, 0), "The import of 'ModuleA' is redundant")]
185+ , testSession "package imports" $ do
186+ let thisDataListContent = T.unlines
187+ [ "module Data.List where"
190+ let mainContent = T.unlines
191+ [ "{-# LANGUAGE PackageImports #-}"
192+ , "module Main where"
193+ , "import qualified \"this\" Data.List as ThisList"
194+ , "import qualified \"base\" Data.List as BaseList"
195+ , "useThis = ThisList.x"
196+ , "useBase = BaseList.map"
197+ , "wrong1 = ThisList.map"
198+ , "wrong2 = BaseList.x"
200+ _ <- openDoc' "Data/List.hs" "haskell" thisDataListContent
201+ _ <- openDoc' "Main.hs" "haskell" mainContent
204+ , [(DsError, (6, 9), "Not in scope: \8216ThisList.map\8217")
205+ ,(DsError, (7, 9), "Not in scope: \8216BaseList.x\8217")
187codeActionTests :: TestTree
211codeActionTests :: TestTree