[commit: ghc] master: Update T5129 test: (57001d9)

git at git.haskell.org git at git.haskell.org
Tue Mar 20 07:50:01 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/57001d93da7b50a58e67a712bd4d4cee1d004b6a/ghc

>---------------------------------------------------------------

commit 57001d93da7b50a58e67a712bd4d4cee1d004b6a
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Tue Mar 20 10:48:14 2018 +0300

    Update T5129 test:
    
    - Add some comments
    - Remove $s as they complicate desugarer output for no reason
    - Remove an indirection, case_negative is now main


>---------------------------------------------------------------

57001d93da7b50a58e67a712bd4d4cee1d004b6a
 testsuite/tests/codeGen/should_run/T5129.hs | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/testsuite/tests/codeGen/should_run/T5129.hs b/testsuite/tests/codeGen/should_run/T5129.hs
index 6bc1912..2808f54 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



More information about the ghc-commits mailing list