File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
plugins/hls-tactics-plugin/test Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -110,17 +110,18 @@ mkGoldenTest eq tc occ line col input =
110110 doc <- openDoc (input <.> " hs" ) " haskell"
111111 _ <- waitForDiagnostics
112112 actions <- getCodeActions doc $ pointRange line col
113- Just (InR CodeAction {_command = Just c})
114- <- pure $ find ((== Just (tacticTitle tc occ)) . codeActionTitle) actions
115- executeCommand c
116- _resp <- skipManyTill anyMessage (message SWorkspaceApplyEdit )
117- edited <- documentContents doc
118- let expected_name = input <.> " expected" <.> " hs"
119- -- Write golden tests if they don't already exist
120- liftIO $ (doesFileExist expected_name >>= ) $ flip unless $ do
121- T. writeFile expected_name edited
122- expected <- liftIO $ T. readFile expected_name
123- liftIO $ edited `eq` expected
113+ case find ((== Just (tacticTitle tc occ)) . codeActionTitle) actions of
114+ Just (InR CodeAction {_command = Just c}) -> do
115+ executeCommand c
116+ _resp <- skipManyTill anyMessage (message SWorkspaceApplyEdit )
117+ edited <- documentContents doc
118+ let expected_name = input <.> " expected" <.> " hs"
119+ -- Write golden tests if they don't already exist
120+ liftIO $ (doesFileExist expected_name >>= ) $ flip unless $ do
121+ T. writeFile expected_name edited
122+ expected <- liftIO $ T. readFile expected_name
123+ liftIO $ edited `eq` expected
124+ other -> error $ show other
124125
125126
126127mkCodeLensTest
You can’t perform that action at this time.
0 commit comments