@@ -16,7 +16,6 @@ import Test.Hls.Util
1616import Test.Tasty
1717import Test.Tasty.ExpectedFailure (ignoreTestBecause )
1818import Test.Tasty.HUnit
19- import Test.Hspec.Expectations
2019
2120
2221tests :: TestTree
@@ -30,16 +29,16 @@ tests = testGroup "deferred responses" [
3029
3130 -- skipMany anyNotification
3231 -- hoverRsp <- message :: Session HoverResponse
33- -- liftIO $ hoverRsp ^? result . _Just . _Just . contents `shouldBe` Nothing
34- -- liftIO $ hoverRsp ^. LSP.id `shouldBe` responseId id1
32+ -- liftIO $ hoverRsp ^? result . _Just . _Just . contents @?= Nothing
33+ -- liftIO $ hoverRsp ^. LSP.id @?= responseId id1
3534
3635 -- id2 <- sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams doc Nothing)
3736 -- symbolsRsp <- skipManyTill anyNotification message :: Session DocumentSymbolsResponse
38- -- liftIO $ symbolsRsp ^. LSP.id `shouldBe` responseId id2
37+ -- liftIO $ symbolsRsp ^. LSP.id @?= responseId id2
3938
4039 -- id3 <- sendRequest TextDocumentHover (TextDocumentPositionParams doc (Position 4 2) Nothing)
4140 -- hoverRsp2 <- skipManyTill anyNotification message :: Session HoverResponse
42- -- liftIO $ hoverRsp2 ^. LSP.id `shouldBe` responseId id3
41+ -- liftIO $ hoverRsp2 ^. LSP.id @?= responseId id3
4342
4443 -- let contents2 = hoverRsp2 ^? result . _Just . _Just . contents
4544 -- liftIO $ contents2 `shouldNotSatisfy` null
@@ -48,7 +47,7 @@ tests = testGroup "deferred responses" [
4847 -- let highlightParams = TextDocumentPositionParams doc (Position 7 0) Nothing
4948 -- highlightRsp <- request TextDocumentDocumentHighlight highlightParams
5049 -- let (Just (List locations)) = highlightRsp ^. result
51- -- liftIO $ locations `shouldBe` [ DocumentHighlight
50+ -- liftIO $ locations @?= [ DocumentHighlight
5251 -- { _range = Range
5352 -- { _start = Position {_line = 7, _character = 0}
5453 -- , _end = Position {_line = 7, _character = 2}
@@ -95,15 +94,15 @@ tests = testGroup "deferred responses" [
9594 testCase " instantly respond to failed modules with no cache" $ runSession hieCommand fullCaps " test/testdata" $ do
9695 doc <- openDoc " FuncTestFail.hs" " haskell"
9796 defs <- getDefinitions doc (Position 1 11 )
98- liftIO $ defs `shouldBe` []
97+ liftIO $ defs @?= []
9998
10099 -- TODO: the benefits of caching parsed modules is doubted.
101100 -- TODO: add issue link
102101 -- , testCase "respond to untypecheckable modules with parsed module cache" $
103102 -- runSession hieCommand fullCaps "test/testdata" $ do
104103 -- doc <- openDoc "FuncTestFail.hs" "haskell"
105104 -- (Left (sym:_)) <- getDocumentSymbols doc
106- -- liftIO $ sym ^. name `shouldBe` "main"
105+ -- liftIO $ sym ^. name @?= "main"
107106
108107 -- TODO does not compile
109108 -- , testCase "returns hints as diagnostics" $ runSession hieCommand fullCaps "test/testdata" $ do
@@ -113,7 +112,7 @@ tests = testGroup "deferred responses" [
113112 -- let testUri = filePathToUri $ cwd </> "test/testdata/FuncTest.hs"
114113
115114 -- diags <- skipManyTill loggingNotification publishDiagnosticsNotification
116- -- liftIO $ diags ^? params `shouldBe` (Just $ PublishDiagnosticsParams
115+ -- liftIO $ diags ^? params @?= (Just $ PublishDiagnosticsParams
117116 -- { _uri = testUri
118117 -- , _diagnostics = List
119118 -- [ Diagnostic
@@ -130,12 +129,12 @@ tests = testGroup "deferred responses" [
130129 -- args = List [Object args']
131130 --
132131 -- executeRsp <- request WorkspaceExecuteCommand (ExecuteCommandParams "hare:demote" (Just args) Nothing)
133- -- liftIO $ executeRsp ^. result `shouldBe` Just (Object H.empty)
132+ -- liftIO $ executeRsp ^. result @?= Just (Object H.empty)
134133
135134 -- editReq <- message :: Session ApplyWorkspaceEditRequest
136135 -- let expectedTextEdits = List [TextEdit (Range (Position 6 0) (Position 7 6)) " where\n bb = 5"]
137136 -- expectedTextDocEdits = List [TextDocumentEdit (VersionedTextDocumentIdentifier testUri (Just 0)) expectedTextEdits]
138- -- liftIO $ editReq ^. params . edit `shouldBe` WorkspaceEdit
137+ -- liftIO $ editReq ^. params . edit @?= WorkspaceEdit
139138 -- Nothing
140139 -- (Just expectedTextDocEdits)
141140 -- , multiServerTests
@@ -165,13 +164,13 @@ multiMainTests = testGroup "multiple main modules" [
165164 diagsRspGhc <- skipManyTill anyNotification message :: Session PublishDiagnosticsNotification
166165 let (List diags) = diagsRspGhc ^. params . diagnostics
167166
168- liftIO $ length diags `shouldBe` 2
167+ liftIO $ length diags @?= 2
169168
170169 _doc2 <- openDoc " HaReRename.hs" " haskell"
171170 _diagsRspHlint2 <- skipManyTill anyNotification message :: Session PublishDiagnosticsNotification
172171 -- errMsg <- skipManyTill anyNotification notification :: Session ShowMessageNotification
173172 diagsRsp2 <- skipManyTill anyNotification message :: Session PublishDiagnosticsNotification
174173 let (List diags2) = diagsRsp2 ^. params . diagnostics
175174
176- liftIO $ show diags2 `shouldBe` " []"
175+ liftIO $ show diags2 @?= " []"
177176 ]
0 commit comments