Commit 57001d93 authored by Ömer Sinan Ağacan's avatar Ömer Sinan Ağacan

Update T5129 test:

- Add some comments
- Remove $s as they complicate desugarer output for no reason
- Remove an indirection, case_negative is now main
parent 60aa53d9
......@@ -10,12 +10,13 @@ throwIfNegative n | n < 0 = error "negative"
data HUnitFailure = HUnitFailure String deriving (Show,Typeable)
instance Exception HUnitFailure
assertFailure :: String -> a -- Not an IO function!
assertFailure msg = E.throw (HUnitFailure msg)
case_negative =
handleJust errorCalls (const $ return ()) $ do
evaluate $ throwIfNegative (-1)
assertFailure "must throw when given a negative number"
main :: IO ()
main =
handleJust errorCalls (const (return ())) (do
evaluate (throwIfNegative (-1)) -- Pure expression evaluated in IO
assertFailure "must throw when given a negative number")
where errorCalls (ErrorCall _) = Just ()
main = case_negative
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment