git.iko.soy/distributed-process
on master help sign in
cosmetic/whitespace
2cb516cTim Watson
distributed-process/tests/TestCH.hs+9−9
@@ -771,7 +771,7 @@ testMatchAnyHandle transport = do
771 proxyServer <- forkProcess localNode $ forever $ do
771 proxyServer <- forkProcess localNode $ forever $ do
772 receiveWait [
772 receiveWait [
773 matchAny (maybeForward mathServer)
773 matchAny (maybeForward mathServer)
774− ]
774+ ]
775 putMVar proxyAddr proxyServer
775 putMVar proxyAddr proxyServer
776
776
777 -- Client
777 -- Client
@@ -808,13 +808,13 @@ testMatchAnyNoHandle transport = do
808 (\(Add _ _ _) -> True)
808 (\(Add _ _ _) -> True)
809 -- the match `AbstractMessage -> Process ()` will succeed!
809 -- the match `AbstractMessage -> Process ()` will succeed!
810 (\m -> do
810 (\m -> do
811− -- `String -> Process ()` does *not* match the input types however
811+ -- `String -> Process ()` does *not* match the input types however
812 r <- (maybeHandleMessage m (\(_ :: String) -> die "NONSENSE" ))
812 r <- (maybeHandleMessage m (\(_ :: String) -> die "NONSENSE" ))
813 case r of
813 case r of
814 Nothing -> return ()
814 Nothing -> return ()
815 Just _ -> die "NONSENSE")
815 Just _ -> die "NONSENSE")
816− ]
816+ ]
817− -- we *must* have removed the message from our mailbox though!!!
817+ -- we *must* have removed the message from our mailbox though!!!
818 Nothing <- receiveTimeout 100000 [ match (\(Add _ _ _) -> return ()) ]
818 Nothing <- receiveTimeout 100000 [ match (\(Add _ _ _) -> return ()) ]
819 liftIO $ putMVar serverDone ()
819 liftIO $ putMVar serverDone ()
820 putMVar addr server
820 putMVar addr server
@@ -835,7 +835,7 @@ testMatchAnyNoHandle transport = do
835
835
836-- | Test 'matchAnyIf'. We provide an /echo/ server, but it ignores requests
836-- | Test 'matchAnyIf'. We provide an /echo/ server, but it ignores requests
837-- unless the text body @/= "bar"@ - this case should time out rather than
837-- unless the text body @/= "bar"@ - this case should time out rather than
838−-- removing the message from the process mailbox.
838+-- removing the message from the process mailbox.
839testMatchAnyIf :: NT.Transport -> Assertion
839testMatchAnyIf :: NT.Transport -> Assertion
840testMatchAnyIf transport = do
840testMatchAnyIf transport = do
841 echoAddr <- newEmptyMVar
841 echoAddr <- newEmptyMVar
@@ -848,7 +848,7 @@ testMatchAnyIf transport = do
848 receiveWait [
848 receiveWait [
849 matchAnyIf (\(_ :: ProcessId, (s :: String)) -> s /= "bar")
849 matchAnyIf (\(_ :: ProcessId, (s :: String)) -> s /= "bar")
850 handleMessage
850 handleMessage
851− ]
851+ ]
852 putMVar echoAddr echoServer
852 putMVar echoAddr echoServer
853
853
854 -- Client
854 -- Client
@@ -1013,7 +1013,7 @@ testCatchesExit :: NT.Transport -> Assertion
1013testCatchesExit transport = do
1013testCatchesExit transport = do
1014 localNode <- newLocalNode transport initRemoteTable
1014 localNode <- newLocalNode transport initRemoteTable
1015 done <- newEmptyMVar
1015 done <- newEmptyMVar
1016−
1016+
1017 _ <- forkProcess localNode $ do
1017 _ <- forkProcess localNode $ do
1018 (die ("foobar", 123 :: Int))
1018 (die ("foobar", 123 :: Int))
1019 `catchesExit` [
1019 `catchesExit` [
@@ -1029,7 +1029,7 @@ testDie :: NT.Transport -> Assertion
1029testDie transport = do
1029testDie transport = do
1030 localNode <- newLocalNode transport initRemoteTable
1030 localNode <- newLocalNode transport initRemoteTable
1031 done <- newEmptyMVar
1031 done <- newEmptyMVar
1032−
1032+
1033 _ <- forkProcess localNode $ do
1033 _ <- forkProcess localNode $ do
1034 (die ("foobar", 123 :: Int))
1034 (die ("foobar", 123 :: Int))
1035 `catchExit` \_from reason -> do
1035 `catchExit` \_from reason -> do
@@ -1043,7 +1043,7 @@ testPrettyExit :: NT.Transport -> Assertion
1043testPrettyExit transport = do
1043testPrettyExit transport = do
1044 localNode <- newLocalNode transport initRemoteTable
1044 localNode <- newLocalNode transport initRemoteTable
1045 done <- newEmptyMVar
1045 done <- newEmptyMVar
1046−
1046+
1047 _ <- forkProcess localNode $ do
1047 _ <- forkProcess localNode $ do
1048 (die "timeout")
1048 (die "timeout")
1049 `catch` \ex@(ProcessExitException from _) ->
1049 `catch` \ex@(ProcessExitException from _) ->