Commit 6e1b38c9 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Make the exception tests use OldException, as that's what they test

parent 7b967ed6
module Main where
import Prelude hiding (catch)
import Control.Exception
import Control.OldException
main = do
module Main where
import qualified Control.Exception;
import qualified Control.OldException as Exception;
import Data.IORef;
import Prelude;
safeCatch :: IO () -> IO ();
safeCatch f = Control.Exception.catch f (\_ -> return ());
safeCatch f = Exception.catch f (\_ -> return ());
type Thrower = IO Bool;
......@@ -64,20 +64,20 @@ module Main where
errorThrower = MkNamed "error" (error "some error");
throwThrower :: Named Thrower;
throwThrower = MkNamed "Control.Exception.throw"
(Control.Exception.throw (Control.Exception.ErrorCall "throw error"));
throwThrower = MkNamed "Exception.throw"
(Exception.throw (Exception.ErrorCall "throw error"));
ioErrorErrorCallThrower :: Named Thrower;
ioErrorErrorCallThrower = MkNamed "ioError ErrorCall"
(Control.Exception.throwIO (Control.Exception.ErrorCall "throw error"));
(Exception.throwIO (Exception.ErrorCall "throw error"));
ioErrorIOExceptionThrower :: Named Thrower;
ioErrorIOExceptionThrower = MkNamed "ioError IOException"
(Control.Exception.throwIO (Control.Exception.IOException undefined));
(Exception.throwIO (Exception.IOException undefined));
returnThrowThrower :: Named Thrower;
returnThrowThrower = MkNamed "return Control.Exception.throw"
(return (Control.Exception.throw (Control.Exception.ErrorCall "throw error")));
returnThrowThrower = MkNamed "return Exception.throw"
(return (Exception.throw (Exception.ErrorCall "throw error")));
-- catchers
......@@ -90,12 +90,12 @@ module Main where
(\f cc -> Prelude.catch (f >> (return ())) (const cc));
ceCatchCatcher :: Named Catcher;
ceCatchCatcher = MkNamed "Control.Exception.catch"
(\f cc -> Control.Exception.catch (f >> (return ())) (const cc));
ceCatchCatcher = MkNamed "Exception.catch"
(\f cc -> Exception.catch (f >> (return ())) (const cc));
finallyCatcher :: Named Catcher;
finallyCatcher = MkNamed "Control.Exception.finally"
(\f cc -> Control.Exception.finally (f >> (return ())) cc);
finallyCatcher = MkNamed "Exception.finally"
(\f cc -> Exception.finally (f >> (return ())) cc);
main = checkNamedCatches
>> CAUGHT return
>> CAUGHT return undefined
>> CAUGHT return Control.Exception.throw
>> CAUGHT return Exception.throw
>> CAUGHT return error
>> MISSED fail
>> MISSED error
>> MISSED Control.Exception.throw
>> MISSED Exception.throw
>> MISSED ioError ErrorCall
>> MISSED ioError IOException
>> MISSED undefined
Prelude.catch MISSED return
Prelude.catch MISSED return undefined
Prelude.catch MISSED return Control.Exception.throw
Prelude.catch MISSED return Exception.throw
Prelude.catch MISSED return error
Prelude.catch CAUGHT fail
Prelude.catch MISSED error
Prelude.catch MISSED Control.Exception.throw
Prelude.catch MISSED Exception.throw
Prelude.catch MISSED ioError ErrorCall
Prelude.catch CAUGHT ioError IOException
Prelude.catch MISSED undefined
Control.Exception.catch MISSED return
Control.Exception.catch MISSED return undefined
Control.Exception.catch MISSED return Control.Exception.throw
Control.Exception.catch MISSED return error
Control.Exception.catch CAUGHT fail
Control.Exception.catch CAUGHT error
Control.Exception.catch CAUGHT Control.Exception.throw
Control.Exception.catch CAUGHT ioError ErrorCall
Control.Exception.catch CAUGHT ioError IOException
Control.Exception.catch CAUGHT undefined
Control.Exception.finally CAUGHT return
Control.Exception.finally CAUGHT return undefined
Control.Exception.finally CAUGHT return Control.Exception.throw
Control.Exception.finally CAUGHT return error
Control.Exception.finally CAUGHT fail
Control.Exception.finally CAUGHT error
Control.Exception.finally CAUGHT Control.Exception.throw
Control.Exception.finally CAUGHT ioError ErrorCall
Control.Exception.finally CAUGHT ioError IOException
Control.Exception.finally CAUGHT undefined
Exception.catch MISSED return
Exception.catch MISSED return undefined
Exception.catch MISSED return Exception.throw
Exception.catch MISSED return error
Exception.catch CAUGHT fail
Exception.catch CAUGHT error
Exception.catch CAUGHT Exception.throw
Exception.catch CAUGHT ioError ErrorCall
Exception.catch CAUGHT ioError IOException
Exception.catch CAUGHT undefined
Exception.finally CAUGHT return
Exception.finally CAUGHT return undefined
Exception.finally CAUGHT return Exception.throw
Exception.finally CAUGHT return error
Exception.finally CAUGHT fail
Exception.finally CAUGHT error
Exception.finally CAUGHT Exception.throw
Exception.finally CAUGHT ioError ErrorCall
Exception.finally CAUGHT ioError IOException
Exception.finally CAUGHT undefined
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