@@ -232,6 +232,34 @@ tests = testGroup "diagnostics"
232
232
_ <- createDoc " ModuleB.hs" " haskell" contentB
233
233
_ <- createDoc " ModuleB.hs-boot" " haskell" contentBboot
234
234
expectDiagnostics [(" ModuleB.hs" , [(DiagnosticSeverity_Warning , (3 ,0 ), " Top-level binding" )])]
235
+ , testSession' " bidirectional module dependency with hs-boot" $ \ path -> do
236
+ let cradle = unlines
237
+ [ " cradle:"
238
+ , " direct: {arguments: [ModuleA, ModuleB]}"
239
+ ]
240
+ let contentA = T. unlines
241
+ [ " module ModuleA where"
242
+ , " import {-# SOURCE #-} ModuleB"
243
+ ]
244
+ let contentB = T. unlines
245
+ [ " {-# OPTIONS -Wmissing-signatures#-}"
246
+ , " module ModuleB where"
247
+ , " import {-# SOURCE #-} ModuleA"
248
+ -- introduce an artificial diagnostic
249
+ , " foo = ()"
250
+ ]
251
+ let contentBboot = T. unlines
252
+ [ " module ModuleB where"
253
+ ]
254
+ let contentAboot = T. unlines
255
+ [ " module ModuleA where"
256
+ ]
257
+ liftIO $ writeFile (path </> " hie.yaml" ) cradle
258
+ _ <- createDoc " ModuleA.hs" " haskell" contentA
259
+ _ <- createDoc " ModuleA.hs-boot" " haskell" contentAboot
260
+ _ <- createDoc " ModuleB.hs" " haskell" contentB
261
+ _ <- createDoc " ModuleB.hs-boot" " haskell" contentBboot
262
+ expectDiagnostics [(" ModuleB.hs" , [(DiagnosticSeverity_Warning , (3 ,0 ), " Top-level binding" )])]
235
263
, testSessionWait " correct reference used with hs-boot" $ do
236
264
let contentB = T. unlines
237
265
[ " module ModuleB where"
0 commit comments