@@ -894,6 +894,20 @@ testKillRemote transport = do
894894
895895 takeMVar done
896896
897+testDie :: NT.Transport -> Assertion
898+testDie transport = do
899+ localNode <- newLocalNode transport initRemoteTable
900+ done <- newEmptyMVar
901+
902+ _ <- forkProcess localNode $ do
903+ (die ("foobar", 123 :: Int))
904+ `catchExit` \_from reason -> do
905+ -- TODO: should verify that 'from' has the right value
906+ True <- return $ reason == ("foobar", 123 :: Int)
907+ liftIO $ putMVar done ()
908+
909+ takeMVar done
910+
897911testExitLocal :: NT.Transport -> Assertion
898912testExitLocal transport = do
899913 localNode <- newLocalNode transport initRemoteTable
@@ -961,6 +975,7 @@ tests (transport, transportInternals) = [
961975 , testCase "ReceiveChanFeatures" (testReceiveChanFeatures transport)
962976 , testCase "KillLocal" (testKillLocal transport)
963977 , testCase "KillRemote" (testKillRemote transport)
978+ , testCase "Die" (testDie transport)
964979 , testCase "ExitLocal" (testExitLocal transport)
965980 , testCase "ExitRemote" (testExitRemote transport)
966981 ]