Skip to content

Commit 9c44334

Browse files
committed
fix tests
1 parent 206628c commit 9c44334

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/functional/FunctionalCodeAction.hs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ redundantImportTests = testGroup "redundant import code actions" [
372372
, testCase "doesn't touch other imports" $ runSession hlsCommand noLiteralCaps "test/testdata/redundantImportTest/" $ do
373373
doc <- openDoc "src/MultipleImports.hs" "haskell"
374374
_ <- waitForDiagnosticsFromSource doc "typecheck"
375-
InL cmd : _ <- getAllCodeActions doc
375+
cas <- getAllCodeActions doc
376+
cmd <- liftIO $ inspectCommand cas ["redundant import"]
376377
executeCommand cmd
377378
_ <- anyRequest
378379
contents <- documentContents doc
@@ -439,11 +440,12 @@ signatureTests = testGroup "missing top level signature code actions" [
439440
doc <- openDoc "TopLevelSignature.hs" "haskell"
440441

441442
_ <- waitForDiagnosticsFromSource doc "typecheck"
442-
cas <- map fromAction <$> getAllCodeActions doc
443+
cas <- getAllCodeActions doc
443444

444-
liftIO $ "add signature: main :: IO ()" `elem` map (^. L.title) cas @? "Contains code action"
445+
liftIO $ expectCodeAction cas ["add signature: main :: IO ()"]
445446

446-
executeCodeAction $ head cas
447+
replaceWithStuff <- liftIO $ inspectCodeAction cas ["add signature"]
448+
executeCodeAction replaceWithStuff
447449

448450
contents <- documentContents doc
449451

0 commit comments

Comments
 (0)