@@ -894,6 +894,20 @@ testKillRemote transport = do
895 takeMVar done
895 takeMVar done
897+testDie :: NT.Transport -> Assertion
898+testDie transport = do
899+ localNode <- newLocalNode transport initRemoteTable
900+ done <- newEmptyMVar
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 ()
897testExitLocal :: NT.Transport -> Assertion
911testExitLocal :: NT.Transport -> Assertion
898testExitLocal transport = do
912testExitLocal transport = do
899 localNode <- newLocalNode transport initRemoteTable
913 localNode <- newLocalNode transport initRemoteTable
@@ -961,6 +975,7 @@ tests (transport, transportInternals) = [
961 , testCase "ReceiveChanFeatures" (testReceiveChanFeatures transport)
975 , testCase "ReceiveChanFeatures" (testReceiveChanFeatures transport)
962 , testCase "KillLocal" (testKillLocal transport)
976 , testCase "KillLocal" (testKillLocal transport)
963 , testCase "KillRemote" (testKillRemote transport)
977 , testCase "KillRemote" (testKillRemote transport)
978+ , testCase "Die" (testDie transport)
964 , testCase "ExitLocal" (testExitLocal transport)
979 , testCase "ExitLocal" (testExitLocal transport)
965 , testCase "ExitRemote" (testExitRemote transport)
980 , testCase "ExitRemote" (testExitRemote transport)