Skip to content

Commit

Permalink
Maybe this will elucidate the error
Browse files Browse the repository at this point in the history
  • Loading branch information
isovector committed Jul 23, 2021
1 parent d35de94 commit 6c5b835
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hls-test-utils/src/Test/Hls/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ fromCommand _ = error "Not a command"
onMatch :: [a] -> (a -> Bool) -> String -> IO a
onMatch as predicate err = maybe (fail err) return (find predicate as)

noMatch :: [a] -> (a -> Bool) -> String -> IO ()
noMatch :: Show a => [a] -> (a -> Bool) -> String -> IO ()
noMatch [] _ _ = pure ()
noMatch as predicate err = bool (pure ()) (fail err) (any predicate as)
noMatch as predicate err = bool (pure ()) (fail $ (show as) <> err) (any predicate as)

inspectDiagnostic :: [Diagnostic] -> [T.Text] -> IO Diagnostic
inspectDiagnostic diags s = onMatch diags (\ca -> all (`T.isInfixOf` (ca ^. L.message)) s) err
Expand Down

0 comments on commit 6c5b835

Please sign in to comment.