Skip to content

Commit efe14bc

Browse files
committed
Fix tests properly
1 parent d1acd85 commit efe14bc

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

test/functional/FunctionalCodeAction.hs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Control.Monad
99
import Data.Aeson
1010
import qualified Data.HashMap.Strict as HM
1111
import Data.List
12+
import qualified Data.Map as M
1213
import Data.Maybe
1314
import qualified Data.Text as T
1415
import Ide.Plugin.Config
@@ -400,9 +401,9 @@ redundantImportTests = testGroup "redundant import code actions" [
400401

401402
typedHoleTests :: TestTree
402403
typedHoleTests = testGroup "typed hole code actions" [
403-
ignoreTestBecause "Wingman changes the result of this test when enabled" $
404404
testCase "works" $
405405
runSession hlsCommand fullCaps "test/testdata" $ do
406+
disableWingman
406407
doc <- openDoc "TypedHoles.hs" "haskell"
407408
_ <- waitForDiagnosticsFromSource doc "typecheck"
408409
cas <- getAllCodeActions doc
@@ -421,9 +422,9 @@ typedHoleTests = testGroup "typed hole code actions" [
421422
, "foo x = maxBound"
422423
]
423424

424-
, ignoreTestBecause "Wingman changes the result of this test when enabled" $
425-
testCase "shows more suggestions" $
425+
, testCase "shows more suggestions" $
426426
runSession hlsCommand fullCaps "test/testdata" $ do
427+
disableWingman
427428
doc <- openDoc "TypedHoles2.hs" "haskell"
428429
_ <- waitForDiagnosticsFromSource doc "typecheck"
429430
cas <- getAllCodeActions doc
@@ -525,6 +526,17 @@ unusedTermTests = testGroup "unused term code actions" [
525526
all (Just CodeActionRefactorInline ==) kinds @? "All CodeActionRefactorInline"
526527
]
527528

529+
disableWingman :: Session ()
530+
disableWingman =
531+
sendConfigurationChanged $ def
532+
{ plugins = M.fromList [ ("tactics", def { plcGlobalOn = False }) ]
533+
}
534+
535+
536+
sendConfigurationChanged :: Config -> Session ()
537+
sendConfigurationChanged config =
538+
sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))
539+
528540
noLiteralCaps :: C.ClientCapabilities
529541
noLiteralCaps = def { C._textDocument = Just textDocumentCaps }
530542
where

0 commit comments

Comments
 (0)