@@ -31,6 +31,7 @@ import Control.Distributed.Process.Internal.Types
31 ( NodeId(nodeAddress)
31 ( NodeId(nodeAddress)
32 , LocalNode(localEndPoint)
32 , LocalNode(localEndPoint)
33 , ProcessExitException(..)
33 , ProcessExitException(..)
35import Control.Distributed.Process.Node
36import Control.Distributed.Process.Node
36import Control.Distributed.Process.Serializable (Serializable)
37import Control.Distributed.Process.Serializable (Serializable)
@@ -1025,6 +1026,20 @@ testCatchesExit transport = do
1026 takeMVar done
1027 takeMVar done
1029+testCatches :: NT.Transport -> Assertion
1030+testCatches transport = do
1031+ localNode <- newLocalNode transport initRemoteTable
1032+ done <- newEmptyMVar
1034+ _ <- forkProcess localNode $ do
1035+ node <- getSelfNode
1036+ (liftIO $ throwIO (ProcessLinkException (nullProcessId node) DiedNormal))
1038+ Handler (\(ProcessLinkException _ _) -> liftIO $ putMVar done ())
1028testDie :: NT.Transport -> Assertion
1043testDie :: NT.Transport -> Assertion
1029testDie transport = do
1044testDie transport = do
1030 localNode <- newLocalNode transport initRemoteTable
1045 localNode <- newLocalNode transport initRemoteTable
@@ -1127,6 +1142,7 @@ tests (transport, transportInternals) = [
1127 , testCase "Die" (testDie transport)
1142 , testCase "Die" (testDie transport)
1128 , testCase "PrettyExit" (testPrettyExit transport)
1143 , testCase "PrettyExit" (testPrettyExit transport)
1129 , testCase "CatchesExit" (testCatchesExit transport)
1144 , testCase "CatchesExit" (testCatchesExit transport)
1145+ , testCase "Catches" (testCatches transport)
1130 , testCase "ExitLocal" (testExitLocal transport)
1146 , testCase "ExitLocal" (testExitLocal transport)
1131 , testCase "ExitRemote" (testExitRemote transport)
1147 , testCase "ExitRemote" (testExitRemote transport)