distributed-process-execution 0.1.3.0 → 0.1.4.0
raw patch · 4 files changed
+38/−33 lines, 4 filesdep −rematchdep ~distributed-process-systestPVP ok
version bump matches the API change (PVP)
Dependencies removed: rematch
Dependency ranges changed: distributed-process-systest
API changes (from Hackage documentation)
Files
- ChangeLog +4/−0
- distributed-process-execution.cabal +6/−8
- tests/TestExchange.hs +23/−19
- tests/TestMailbox.hs +5/−6
ChangeLog view
@@ -1,3 +1,7 @@+2024-10-30 Laurent P. René de Cotret <laurent.decotret@outlook.com> 0.1.4.0++* Removed dependency on `rematch` (#459)+ 2024-09-03 Laurent P. René de Cotret <laurent.decotret@outlook.com> 0.1.3.0 * Bumped dependency bounds to support GHC 8.10.7 - GHC 9.10.1
distributed-process-execution.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: distributed-process-execution-version: 0.1.3.0+version: 0.1.4.0 build-type: Simple license: BSD-3-Clause license-file: LICENCE@@ -44,7 +44,7 @@ distributed-process-supervisor >= 0.2.0 && < 0.3, distributed-process-client-server >= 0.2.0 && < 0.3, binary >= 0.8 && < 0.9,- deepseq >= 1.4 && < 1.6,+ deepseq >= 1.4 && < 1.7, mtl, containers >= 0.6 && < 0.8, hashable >= 1.2.0.5 && < 1.6,@@ -79,7 +79,7 @@ distributed-process, distributed-process-execution, distributed-process-extras,- distributed-process-systest >= 0.1.1 && < 0.4,+ distributed-process-systest ^>= 0.4, distributed-static, bytestring, data-accessor,@@ -98,11 +98,10 @@ QuickCheck >= 2.4, test-framework-quickcheck2, transformers,- rematch >= 0.2.0.0, ghc-prim hs-source-dirs: tests- ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind -eventlog+ ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind main-is: TestExchange.hs default-language: Haskell2010 @@ -120,7 +119,7 @@ distributed-process, distributed-process-execution, distributed-process-extras,- distributed-process-systest >= 0.1.1 && < 0.4,+ distributed-process-systest ^>= 0.4, distributed-static, bytestring, data-accessor,@@ -139,11 +138,10 @@ QuickCheck >= 2.4, test-framework-quickcheck2, transformers,- rematch >= 0.2.0.0, ghc-prim hs-source-dirs: tests- ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind -eventlog+ ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind main-is: TestMailbox.hs other-modules: MailboxTestFilters default-language: Haskell2010
tests/TestExchange.hs view
@@ -18,13 +18,13 @@ ) import Control.Distributed.Process.SysTest.Utils import Control.Monad (void, forM, forever)-import Control.Rematch (equalTo) import Prelude hiding (drop) import Network.Transport.TCP import qualified Network.Transport as NT import Test.Framework as TF (defaultMain, testGroup, Test) import Test.Framework.Providers.HUnit+import Test.HUnit (assertEqual, assertBool) testKeyBasedRouting :: TestResult Bool -> Process () testKeyBasedRouting result = do@@ -67,20 +67,22 @@ received <- forM (replicate (2 * 3) us) (const $ receiveChanTimeout 1000 rp) -- all bindings for 'abc' fired correctly- received `shouldContain` Just (p1, Left "Hello")- received `shouldContain` Just (p3, Left "Hello")- received `shouldContain` Just (p1, Right (123 :: Int))- received `shouldContain` Just (p3, Right (123 :: Int))+ liftIO $ do - -- however the bindings for 'def' never fired- received `shouldContain` Nothing- received `shouldNotContain` Just (p2, Left "Hello")- received `shouldNotContain` Just (p2, Right (123 :: Int))+ assertBool mempty $ Just (p1, Left "Hello") `elem` received+ assertBool mempty $ Just (p3, Left "Hello") `elem` received+ assertBool mempty $ Just (p1, Right (123 :: Int)) `elem` received+ assertBool mempty $ Just (p3, Right (123 :: Int)) `elem` received - -- none of the bindings should have examined the headers!- received `shouldNotContain` Just (p1, Left "Goodbye")- received `shouldNotContain` Just (p2, Left "Goodbye")- received `shouldNotContain` Just (p3, Left "Goodbye")+ -- however the bindings for 'def' never fired+ assertBool mempty $ Nothing `elem` received+ assertBool mempty $ Just (p2, Left "Hello") `notElem` received+ assertBool mempty $ Just (p2, Right (123 :: Int)) `notElem` received+ + -- none of the bindings should have examined the headers!+ assertBool mempty $ Just (p1, Left "Goodbye") `notElem` received+ assertBool mempty $ Just (p2, Left "Goodbye") `notElem` received+ assertBool mempty $ Just (p3, Left "Goodbye") `notElem` received testHeaderBasedRouting :: TestResult () -> Process () testHeaderBasedRouting result = do@@ -110,14 +112,16 @@ received <- forM (replicate 5 us) (const $ receiveChanTimeout 1000 rp) -- all bindings fired correctly- received `shouldContain` Just (p1, Left "Hello")- received `shouldContain` Just (p1, Right (123 :: Int))- received `shouldContain` Just (p2, Right (456 :: Int))- received `shouldContain` Just (p2, Right (789 :: Int))- received `shouldContain` Nothing+ liftIO $ do+ assertBool mempty $ Just (p1, Left "Hello") `elem` received+ assertBool mempty $ Just (p1, Left "Hello") `elem` received+ assertBool mempty $ Just (p1, Right (123 :: Int)) `elem` received+ assertBool mempty $ Just (p2, Right (456 :: Int)) `elem` received+ assertBool mempty $ Just (p2, Right (789 :: Int)) `elem` received+ assertBool mempty $ Nothing `elem` received -- simple check that no other bindings have fired- length received `shouldBe` equalTo (5 :: Int)+ liftIO $ assertEqual mempty 5 (length received) testSimpleEventHandling :: TestResult Bool -> Process () testSimpleEventHandling result = do
tests/TestMailbox.hs view
@@ -13,15 +13,13 @@ import Control.Distributed.Process.Extras.Timer import Control.Distributed.Process.SysTest.Utils --import Control.Rematch (equalTo)- import Prelude hiding (drop) import Data.Maybe (catMaybes) import Test.Framework as TF (defaultMain, testGroup, Test) import Test.Framework.Providers.HUnit+import Test.HUnit (assertEqual) import qualified MailboxTestFilters (__remoteTable) import MailboxTestFilters (myFilter, intFilter)@@ -77,9 +75,10 @@ MailboxStats{ pendingMessages = pending' , droppedMessages = dropped' , currentLimit = limit' } <- statistics mbox- pending' `shouldBe` equalTo 4- dropped' `shouldBe` equalTo 3- limit' `shouldBe` equalTo 4+ liftIO $ do+ assertEqual mempty 4 pending'+ assertEqual mempty 3 dropped'+ assertEqual mempty 4 limit' active mbox acceptEverything Just Delivery{ messages = recvd