ref: 1b2656b4b9409ee1d27707b816cfe5578aa3ef16
parent: 501f8e3a75986cdfcd2cd3abd6c9e040c8724626
author: Lennart Augustsson <lennart@augustsson.net>
date: Wed Nov 8 09:40:10 EST 2023
More tests.
--- a/tests/Catch.hs
+++ b/tests/Catch.hs
@@ -2,9 +2,21 @@
import Prelude
import Control.Exception
+f :: [Int] -> Int
+f (_:_) = 99
+
+class C a where
+ m :: a -> Int
+
+instance C ()
+
main :: IO ()
main = do
x <- catch (return ("o" ++ "k")) (\ _ -> return "what?")putStrLn $ show x
- y <- catch (do { error "bang!"; return "huh?" }) (\ (Exn s) -> return s)+ y <- catch (do { error "bang!"; return "yyy" }) (\ (Exn s) -> return s)putStrLn $ show y
+ z <- catch (do { print (f []); return "zzz" }) (\ (Exn s) -> return s)+ putStrLn $ show z
+ w <- catch (do { print (m ()); return "www" }) (\ (Exn s) -> return s)+ putStrLn $ show w
--- a/tests/Catch.ref
+++ b/tests/Catch.ref
@@ -1,2 +1,4 @@
"ok"
"bang!"
+"no match at ./Catch.hs, line 6, col 1"
+"no default for C.m"
--
⑨