@@ -100,7 +100,7 @@ initializeResponseTests = withResource acquire release tests where
100
100
101
101
diagnosticTests :: TestTree
102
102
diagnosticTests = testGroup " diagnostics"
103
- [ testSession " fix syntax error" $ do
103
+ [ testSessionWait " fix syntax error" $ do
104
104
let content = T. unlines [ " module Testing wher" ]
105
105
doc <- openDoc' " Testing.hs" " haskell" content
106
106
expectDiagnostics [(" Testing.hs" , [(DsError , (0 , 15 ), " parse error" )])]
@@ -111,7 +111,7 @@ diagnosticTests = testGroup "diagnostics"
111
111
}
112
112
changeDoc doc [change]
113
113
expectDiagnostics [(" Testing.hs" , [] )]
114
- , testSession " introduce syntax error" $ do
114
+ , testSessionWait " introduce syntax error" $ do
115
115
let content = T. unlines [ " module Testing where" ]
116
116
doc <- openDoc' " Testing.hs" " haskell" content
117
117
void (message :: Session ProgressStartNotification )
@@ -122,7 +122,7 @@ diagnosticTests = testGroup "diagnostics"
122
122
}
123
123
changeDoc doc [change]
124
124
expectDiagnostics [(" Testing.hs" , [(DsError , (0 , 15 ), " parse error" )])]
125
- , testSession " variable not in scope" $ do
125
+ , testSessionWait " variable not in scope" $ do
126
126
let content = T. unlines
127
127
[ " module Testing where"
128
128
, " foo :: Int -> Int -> Int"
@@ -138,7 +138,7 @@ diagnosticTests = testGroup "diagnostics"
138
138
]
139
139
)
140
140
]
141
- , testSession " type error" $ do
141
+ , testSessionWait " type error" $ do
142
142
let content = T. unlines
143
143
[ " module Testing where"
144
144
, " foo :: Int -> String -> Int"
@@ -150,7 +150,7 @@ diagnosticTests = testGroup "diagnostics"
150
150
, [(DsError , (2 , 14 ), " Couldn't match type '[Char]' with 'Int'" )]
151
151
)
152
152
]
153
- , testSession " typed hole" $ do
153
+ , testSessionWait " typed hole" $ do
154
154
let content = T. unlines
155
155
[ " module Testing where"
156
156
, " foo :: Int -> String"
@@ -177,7 +177,7 @@ diagnosticTests = testGroup "diagnostics"
177
177
expectedDs aMessage =
178
178
[ (" A.hs" , [(DsError , (2 ,4 ), aMessage)])
179
179
, (" B.hs" , [(DsError , (3 ,4 ), bMessage)])]
180
- deferralTest title binding msg = testSession title $ do
180
+ deferralTest title binding msg = testSessionWait title $ do
181
181
_ <- openDoc' " A.hs" " haskell" $ sourceA binding
182
182
_ <- openDoc' " B.hs" " haskell" sourceB
183
183
expectDiagnostics $ expectedDs msg
@@ -188,7 +188,7 @@ diagnosticTests = testGroup "diagnostics"
188
188
, deferralTest " message shows error" " True" " A.hs:3:5: error:"
189
189
]
190
190
191
- , testSession " remove required module" $ do
191
+ , testSessionWait " remove required module" $ do
192
192
let contentA = T. unlines [ " module ModuleA where" ]
193
193
docA <- openDoc' " ModuleA.hs" " haskell" contentA
194
194
let contentB = T. unlines
@@ -203,7 +203,7 @@ diagnosticTests = testGroup "diagnostics"
203
203
}
204
204
changeDoc docA [change]
205
205
expectDiagnostics [(" ModuleB.hs" , [(DsError , (1 , 0 ), " Could not find module" )])]
206
- , testSession " add missing module" $ do
206
+ , testSessionWait " add missing module" $ do
207
207
let contentB = T. unlines
208
208
[ " module ModuleB where"
209
209
, " import ModuleA"
@@ -213,7 +213,7 @@ diagnosticTests = testGroup "diagnostics"
213
213
let contentA = T. unlines [ " module ModuleA where" ]
214
214
_ <- openDoc' " ModuleA.hs" " haskell" contentA
215
215
expectDiagnostics [(" ModuleB.hs" , [] )]
216
- , testSession " cyclic module dependency" $ do
216
+ , testSessionWait " cyclic module dependency" $ do
217
217
let contentA = T. unlines
218
218
[ " module ModuleA where"
219
219
, " import ModuleB"
@@ -232,7 +232,7 @@ diagnosticTests = testGroup "diagnostics"
232
232
, [(DsError , (1 , 7 ), " Cyclic module dependency between ModuleA, ModuleB" )]
233
233
)
234
234
]
235
- , testSession " cyclic module dependency with hs-boot" $ do
235
+ , testSessionWait " cyclic module dependency with hs-boot" $ do
236
236
let contentA = T. unlines
237
237
[ " module ModuleA where"
238
238
, " import {-# SOURCE #-} ModuleB"
@@ -248,7 +248,7 @@ diagnosticTests = testGroup "diagnostics"
248
248
_ <- openDoc' " ModuleB.hs" " haskell" contentB
249
249
_ <- openDoc' " ModuleB.hs-boot" " haskell" contentBboot
250
250
expectDiagnostics []
251
- , testSession " correct reference used with hs-boot" $ do
251
+ , testSessionWait " correct reference used with hs-boot" $ do
252
252
let contentB = T. unlines
253
253
[ " module ModuleB where"
254
254
, " import {-# SOURCE #-} ModuleA"
@@ -273,7 +273,7 @@ diagnosticTests = testGroup "diagnostics"
273
273
_ <- openDoc' " ModuleA.hs-boot" " haskell" contentAboot
274
274
_ <- openDoc' " ModuleC.hs" " haskell" contentC
275
275
expectDiagnostics []
276
- , testSession " redundant import" $ do
276
+ , testSessionWait " redundant import" $ do
277
277
let contentA = T. unlines [" module ModuleA where" ]
278
278
let contentB = T. unlines
279
279
[ " {-# OPTIONS_GHC -Wunused-imports #-}"
@@ -287,7 +287,7 @@ diagnosticTests = testGroup "diagnostics"
287
287
, [(DsWarning , (2 , 0 ), " The import of 'ModuleA' is redundant" )]
288
288
)
289
289
]
290
- , testSession " package imports" $ do
290
+ , testSessionWait " package imports" $ do
291
291
let thisDataListContent = T. unlines
292
292
[ " module Data.List where"
293
293
, " x = 123"
@@ -311,7 +311,7 @@ diagnosticTests = testGroup "diagnostics"
311
311
]
312
312
)
313
313
]
314
- , testSession " unqualified warnings" $ do
314
+ , testSessionWait " unqualified warnings" $ do
315
315
let fooContent = T. unlines
316
316
[ " {-# OPTIONS_GHC -Wredundant-constraints #-}"
317
317
, " module Foo where"
@@ -768,8 +768,10 @@ xfail = flip expectFailBecause
768
768
769
769
770
770
testSession :: String -> Session () -> TestTree
771
- testSession name =
772
- testCase name . run .
771
+ testSession name = testCase name . run
772
+
773
+ testSessionWait :: String -> Session () -> TestTree
774
+ testSessionWait name = testSession name .
773
775
-- Check that any diagnostics produced were already consumed by the test case.
774
776
--
775
777
-- If in future we add test cases where we don't care about checking the diagnostics,
0 commit comments