Skip to content

Commit 2b6230e

Browse files
committed
Add a test
1 parent 2c7cba2 commit 2b6230e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/functional/Completion.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import Test.Tasty
1313
import Test.Tasty.ExpectedFailure (ignoreTestBecause)
1414
import Test.Tasty.HUnit
1515
import qualified Data.Text as T
16+
import Data.Default (def)
17+
import Ide.Plugin.Config (Config (maxCompletions))
1618

1719
tests :: TestTree
1820
tests = testGroup "completions" [
@@ -221,6 +223,12 @@ tests = testGroup "completions" [
221223
liftIO $
222224
item ^. detail @?= Just ":: (a -> b -> c) -> b -> a -> c"
223225

226+
, testCase "maxCompletions" $ runSession hlsCommand fullCaps "test/testdata/completion" $ do
227+
doc <- openDoc "Completion.hs" "haskell"
228+
229+
compls <- getCompletions doc (Position 5 7)
230+
liftIO $ length compls @?= maxCompletions def
231+
224232
, contextTests
225233
, snippetTests
226234
]

0 commit comments

Comments
 (0)