@@ -206,6 +206,24 @@ diagnosticTests = testGroup "diagnostics"
206206 ]
207207 )
208208 ]
209+ , testSession "unqualified warnings" $ do
210+ let fooContent = T.unlines
211+ [ "{-# OPTIONS_GHC -Wredundant-constraints #-}"
212+ , "module Foo where"
213+ , "foo :: Ord a => a -> Int"
214+ , "foo a = 1"
215+ ]
216+ _ <- openDoc' "Foo.hs" "haskell" fooContent
217+ expectDiagnostics
218+ [ ( "Foo.hs"
219+ -- The test is to make sure that warnings contain unqualified names
220+ -- where appropriate. The warning should use an unqualified name 'Ord', not
221+ -- sometihng like 'GHC.Classes.Ord'. The choice of redundant-constraints to
222+ -- test this is fairly arbitrary.
223+ , [(DsWarning, (2, 0), "Redundant constraint: Ord a")
224+ ]
225+ )
226+ ]
209227 ]
210228
211229codeActionTests :: TestTree