Skip to content

Commit f623b82

Browse files
committed
fix tests
1 parent 99c7478 commit f623b82

File tree

1 file changed

+4
-2
lines changed
  • plugins/hls-hlint-plugin/test

1 file changed

+4
-2
lines changed

Diff for: plugins/hls-hlint-plugin/test/Main.hs

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module Main
77
) where
88

99
import Control.Lens ((^.))
10+
import Control.Monad (when)
1011
import Data.Aeson (Value (..), object, toJSON, (.=))
1112
import Data.Functor (void)
1213
import Data.List (find)
@@ -398,7 +399,7 @@ ignoreHintGoldenTest testCaseName goldenFilename point hintName =
398399
goldenTest testCaseName goldenFilename point (getIgnoreHintText hintName)
399400

400401
applyHintGoldenTest :: TestName -> FilePath -> Point -> T.Text -> TestTree
401-
applyHintGoldenTest testCaseName goldenFilename point hintName =
402+
applyHintGoldenTest testCaseName goldenFilename point hintName = do
402403
goldenTest testCaseName goldenFilename point (getApplyHintText hintName)
403404

404405
goldenTest :: TestName -> FilePath -> Point -> T.Text -> TestTree
@@ -409,7 +410,8 @@ goldenTest testCaseName goldenFilename point hintText =
409410
case find ((== Just hintText) . getCodeActionTitle) actions of
410411
Just (InR codeAction) -> do
411412
executeCodeAction codeAction
412-
void $ skipManyTill anyMessage $ getDocumentEdit document
413+
when (isJust (codeAction ^. L.command)) $
414+
void $ skipManyTill anyMessage $ getDocumentEdit document
413415
_ -> liftIO $ assertFailure $ makeCodeActionNotFoundAtString point
414416

415417
setupGoldenHlintTest :: TestName -> FilePath -> (TextDocumentIdentifier -> Session ()) -> TestTree

0 commit comments

Comments
 (0)