Skip to content

Commit 646a691

Browse files
committed
Add test
1 parent 630195e commit 646a691

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ghcide/test/exe/Main.hs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ import Development.IDE.Plugin.Test (WaitForIdeRuleResult(..), TestRequest(BlockS
6464
import Control.Monad.Extra (whenJust)
6565
import qualified Language.Haskell.LSP.Types.Lens as L
6666
import Control.Lens ((^.))
67+
import Development.IDE.Plugin.Completions (maxCompletions)
6768

6869
main :: IO ()
6970
main = do
@@ -3213,7 +3214,17 @@ otherCompletionTests = [
32133214
-- This should be sufficient to detect that we are in a
32143215
-- type context and only show the completion to the type.
32153216
(Position 3 11)
3216-
[("Integer", CiStruct, "Integer ", True, True, Nothing)]
3217+
[("Integer", CiStruct, "Integer ", True, True, Nothing)],
3218+
3219+
testSessionWait "maxCompletions" $ do
3220+
doc <- createDoc "A.hs" "haskell" $ T.unlines
3221+
[ "{-# OPTIONS_GHC -Wunused-binds #-}",
3222+
"module A () where",
3223+
"a = Prelude."
3224+
]
3225+
_ <- waitForDiagnostics
3226+
compls <- getCompletions doc (Position 3 13)
3227+
liftIO $ length compls @?= maxCompletions
32173228
]
32183229

32193230
highlightTests :: TestTree

0 commit comments

Comments
 (0)