summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2018-03-20 10:48:14 +0300
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2018-03-20 10:48:14 +0300
commit57001d93da7b50a58e67a712bd4d4cee1d004b6a (patch)
tree824eed317dfc564e44b5893e397ebdcafb57408e
parent60aa53d97da1bbfbb88e9f2791c3f686ba34e764 (diff)
downloadhaskell-57001d93da7b50a58e67a712bd4d4cee1d004b6a.tar.gz
Update T5129 test:
- Add some comments - Remove $s as they complicate desugarer output for no reason - Remove an indirection, case_negative is now main
-rw-r--r--testsuite/tests/codeGen/should_run/T5129.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/testsuite/tests/codeGen/should_run/T5129.hs b/testsuite/tests/codeGen/should_run/T5129.hs
index 6bc1912754..2808f54eae 100644
--- a/testsuite/tests/codeGen/should_run/T5129.hs
+++ b/testsuite/tests/codeGen/should_run/T5129.hs
@@ -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