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

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" ...@@ -10,12 +10,13 @@ throwIfNegative n | n < 0 = error "negative"
data HUnitFailure = HUnitFailure String deriving (Show,Typeable) data HUnitFailure = HUnitFailure String deriving (Show,Typeable)
instance Exception HUnitFailure instance Exception HUnitFailure
assertFailure :: String -> a -- Not an IO function!
assertFailure msg = E.throw (HUnitFailure msg) assertFailure msg = E.throw (HUnitFailure msg)
case_negative = main :: IO ()
handleJust errorCalls (const $ return ()) $ do main =
evaluate $ throwIfNegative (-1) handleJust errorCalls (const (return ())) (do
assertFailure "must throw when given a negative number" evaluate (throwIfNegative (-1)) -- Pure expression evaluated in IO
assertFailure "must throw when given a negative number")
where errorCalls (ErrorCall _) = Just () 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