@@ -16,7 +16,6 @@ import Test.Hls.Util
16
16
import Test.Tasty
17
17
import Test.Tasty.ExpectedFailure (ignoreTestBecause )
18
18
import Test.Tasty.HUnit
19
- import Test.Hspec.Expectations
20
19
21
20
22
21
tests :: TestTree
@@ -30,16 +29,16 @@ tests = testGroup "deferred responses" [
30
29
31
30
-- skipMany anyNotification
32
31
-- 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
35
34
36
35
-- id2 <- sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams doc Nothing)
37
36
-- symbolsRsp <- skipManyTill anyNotification message :: Session DocumentSymbolsResponse
38
- -- liftIO $ symbolsRsp ^. LSP.id `shouldBe` responseId id2
37
+ -- liftIO $ symbolsRsp ^. LSP.id @?= responseId id2
39
38
40
39
-- id3 <- sendRequest TextDocumentHover (TextDocumentPositionParams doc (Position 4 2) Nothing)
41
40
-- hoverRsp2 <- skipManyTill anyNotification message :: Session HoverResponse
42
- -- liftIO $ hoverRsp2 ^. LSP.id `shouldBe` responseId id3
41
+ -- liftIO $ hoverRsp2 ^. LSP.id @?= responseId id3
43
42
44
43
-- let contents2 = hoverRsp2 ^? result . _Just . _Just . contents
45
44
-- liftIO $ contents2 `shouldNotSatisfy` null
@@ -48,7 +47,7 @@ tests = testGroup "deferred responses" [
48
47
-- let highlightParams = TextDocumentPositionParams doc (Position 7 0) Nothing
49
48
-- highlightRsp <- request TextDocumentDocumentHighlight highlightParams
50
49
-- let (Just (List locations)) = highlightRsp ^. result
51
- -- liftIO $ locations `shouldBe` [ DocumentHighlight
50
+ -- liftIO $ locations @?= [ DocumentHighlight
52
51
-- { _range = Range
53
52
-- { _start = Position {_line = 7, _character = 0}
54
53
-- , _end = Position {_line = 7, _character = 2}
@@ -95,15 +94,15 @@ tests = testGroup "deferred responses" [
95
94
testCase " instantly respond to failed modules with no cache" $ runSession hieCommand fullCaps " test/testdata" $ do
96
95
doc <- openDoc " FuncTestFail.hs" " haskell"
97
96
defs <- getDefinitions doc (Position 1 11 )
98
- liftIO $ defs `shouldBe` []
97
+ liftIO $ defs @?= []
99
98
100
99
-- TODO: the benefits of caching parsed modules is doubted.
101
100
-- TODO: add issue link
102
101
-- , testCase "respond to untypecheckable modules with parsed module cache" $
103
102
-- runSession hieCommand fullCaps "test/testdata" $ do
104
103
-- doc <- openDoc "FuncTestFail.hs" "haskell"
105
104
-- (Left (sym:_)) <- getDocumentSymbols doc
106
- -- liftIO $ sym ^. name `shouldBe` "main"
105
+ -- liftIO $ sym ^. name @?= "main"
107
106
108
107
-- TODO does not compile
109
108
-- , testCase "returns hints as diagnostics" $ runSession hieCommand fullCaps "test/testdata" $ do
@@ -113,7 +112,7 @@ tests = testGroup "deferred responses" [
113
112
-- let testUri = filePathToUri $ cwd </> "test/testdata/FuncTest.hs"
114
113
115
114
-- diags <- skipManyTill loggingNotification publishDiagnosticsNotification
116
- -- liftIO $ diags ^? params `shouldBe` (Just $ PublishDiagnosticsParams
115
+ -- liftIO $ diags ^? params @?= (Just $ PublishDiagnosticsParams
117
116
-- { _uri = testUri
118
117
-- , _diagnostics = List
119
118
-- [ Diagnostic
@@ -130,12 +129,12 @@ tests = testGroup "deferred responses" [
130
129
-- args = List [Object args']
131
130
--
132
131
-- 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)
134
133
135
134
-- editReq <- message :: Session ApplyWorkspaceEditRequest
136
135
-- let expectedTextEdits = List [TextEdit (Range (Position 6 0) (Position 7 6)) " where\n bb = 5"]
137
136
-- expectedTextDocEdits = List [TextDocumentEdit (VersionedTextDocumentIdentifier testUri (Just 0)) expectedTextEdits]
138
- -- liftIO $ editReq ^. params . edit `shouldBe` WorkspaceEdit
137
+ -- liftIO $ editReq ^. params . edit @?= WorkspaceEdit
139
138
-- Nothing
140
139
-- (Just expectedTextDocEdits)
141
140
-- , multiServerTests
@@ -165,13 +164,13 @@ multiMainTests = testGroup "multiple main modules" [
165
164
diagsRspGhc <- skipManyTill anyNotification message :: Session PublishDiagnosticsNotification
166
165
let (List diags) = diagsRspGhc ^. params . diagnostics
167
166
168
- liftIO $ length diags `shouldBe` 2
167
+ liftIO $ length diags @?= 2
169
168
170
169
_doc2 <- openDoc " HaReRename.hs" " haskell"
171
170
_diagsRspHlint2 <- skipManyTill anyNotification message :: Session PublishDiagnosticsNotification
172
171
-- errMsg <- skipManyTill anyNotification notification :: Session ShowMessageNotification
173
172
diagsRsp2 <- skipManyTill anyNotification message :: Session PublishDiagnosticsNotification
174
173
let (List diags2) = diagsRsp2 ^. params . diagnostics
175
174
176
- liftIO $ show diags2 `shouldBe` " []"
175
+ liftIO $ show diags2 @?= " []"
177
176
]
0 commit comments