Skip to content

Commit

Permalink
Ignore error codes when testing GHC 9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
noughtmare committed Oct 23, 2024
1 parent 73bba51 commit 6c9860c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hls-test-utils/src/Development/IDE/Test/Diagnostic.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
module Development.IDE.Test.Diagnostic where

import Control.Lens ((^.))
Expand Down Expand Up @@ -35,10 +36,14 @@ requireDiagnostic actuals expected@(severity, cursor, expectedMsg, mbExpectedCod
&& codeMatches d

codeMatches d =
#if MIN_VERSION_GLASGOW_HASKELL(9,5,0,0)
case (mbExpectedCode, _code d) of
(Nothing, _) -> True
(Just expectedCode, Nothing) -> False
(Just expectedCode, Just actualCode) -> InR expectedCode == actualCode
#else
True
#endif

hasTag :: Maybe DiagnosticTag -> Maybe [DiagnosticTag] -> Bool
hasTag Nothing _ = True
Expand Down

0 comments on commit 6c9860c

Please sign in to comment.