Skip to content

Commit 5ff75cd

Browse files
authored
Merge pull request #459 from haskell-distributed/remove-rematch-dependency
Remove rematch dependency
2 parents 0f8db66 + 4f46d96 commit 5ff75cd

File tree

27 files changed

+132
-197
lines changed

27 files changed

+132
-197
lines changed

.github/workflows/cabal.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
run: |
4646
cabal configure --enable-tests --test-show-details=direct
4747
cabal freeze --minimize-conflict-set
48+
cat cabal.project.freeze
4849
4950
- name: Cache cabal work
5051
uses: actions/cache@v4

packages/distributed-process-async/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2024-10-30 Laurent P. René de Cotret <[email protected]> 0.2.9
2+
3+
* Removed dependency on `rematch` (#459)
4+
15
2024-09-03 Laurent P. René de Cotret <[email protected]> 0.2.8
26

37
* Bumped dependency bounds to support GHC 8.10.7 - GHC 9.10.1

packages/distributed-process-async/distributed-process-async.cabal

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: distributed-process-async
3-
version: 0.2.8
3+
version: 0.2.9
44
build-type: Simple
55
license: BSD-3-Clause
66
license-file: LICENCE
@@ -68,7 +68,7 @@ test-suite AsyncTests
6868
ansi-terminal >= 0.5 && < 0.9,
6969
distributed-process,
7070
distributed-process-async,
71-
distributed-process-systest >= 0.2.0,
71+
distributed-process-systest ^>= 0.4,
7272
exceptions >= 0.10 && < 1.0,
7373
network >= 2.5 && < 3.3,
7474
network-transport >= 0.4 && < 0.6,
@@ -79,7 +79,6 @@ test-suite AsyncTests
7979
stm >= 2.3 && < 2.6,
8080
test-framework >= 0.6 && < 0.9,
8181
test-framework-hunit,
82-
rematch >= 0.2.0.0,
8382
transformers
8483
hs-source-dirs:
8584
tests

packages/distributed-process-client-server/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
2024-10-30 Laurent P. René de Cotret <[email protected]> 0.2.7.0
4+
5+
* Removed dependency on `rematch` (#459)
6+
37
2024-09-03 Laurent P. René de Cotret <[email protected]> 0.2.6.0
48

59
* Bumped dependency bounds to support GHC 8.10.7 - GHC 9.10.1

packages/distributed-process-client-server/distributed-process-client-server.cabal

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: distributed-process-client-server
3-
version: 0.2.6.0
3+
version: 0.2.7.0
44
build-type: Simple
55
license: BSD-3-Clause
66
license-file: LICENCE
@@ -79,7 +79,7 @@ test-suite ManagedProcessTests
7979
distributed-process-extras,
8080
distributed-process-async,
8181
distributed-process-client-server,
82-
distributed-process-systest >= 0.1.1,
82+
distributed-process-systest ^>= 0.4,
8383
network-transport >= 0.4 && < 0.7,
8484
mtl,
8585
fingertree,
@@ -92,7 +92,6 @@ test-suite ManagedProcessTests
9292
test-framework >= 0.6 && < 0.9,
9393
test-framework-hunit,
9494
transformers,
95-
rematch >= 0.2.0.0,
9695
ghc-prim,
9796
exceptions
9897
other-modules: Counter,
@@ -118,7 +117,7 @@ test-suite PrioritisedProcessTests
118117
distributed-process-extras,
119118
distributed-process-async,
120119
distributed-process-client-server,
121-
distributed-process-systest >= 0.1.1,
120+
distributed-process-systest ^>= 0.4,
122121
network-transport,
123122
mtl,
124123
fingertree,
@@ -131,7 +130,6 @@ test-suite PrioritisedProcessTests
131130
test-framework,
132131
test-framework-hunit,
133132
transformers,
134-
rematch,
135133
ghc-prim,
136134
exceptions
137135
other-modules: ManagedProcessCommon,

packages/distributed-process-client-server/tests/TestManagedProcess.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import Control.Distributed.Process.ManagedProcess
2020
import Control.Distributed.Process.SysTest.Utils
2121
import Control.Distributed.Process.Extras.Time
2222
import Control.Distributed.Process.Serializable()
23+
import Control.Monad (replicateM_)
2324

2425
import MathsDemo
2526
import Counter
@@ -197,7 +198,7 @@ testCounterExceedsLimit result = do
197198
mref <- monitor pid
198199

199200
-- exceed the limit
200-
9 `times` (void $ incCount pid)
201+
9 `replicateM_` (void $ incCount pid)
201202

202203
-- this time we should fail
203204
_ <- (incCount pid)

packages/distributed-process-execution/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2024-10-30 Laurent P. René de Cotret <[email protected]> 0.1.4.0
2+
3+
* Removed dependency on `rematch` (#459)
4+
15
2024-09-03 Laurent P. René de Cotret <[email protected]> 0.1.3.0
26

37
* Bumped dependency bounds to support GHC 8.10.7 - GHC 9.10.1

packages/distributed-process-execution/distributed-process-execution.cabal

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: distributed-process-execution
3-
version: 0.1.3.0
3+
version: 0.1.4.0
44
build-type: Simple
55
license: BSD-3-Clause
66
license-file: LICENCE
@@ -79,7 +79,7 @@ test-suite ExchangeTests
7979
distributed-process,
8080
distributed-process-execution,
8181
distributed-process-extras,
82-
distributed-process-systest >= 0.1.1 && < 0.4,
82+
distributed-process-systest ^>= 0.4,
8383
distributed-static,
8484
bytestring,
8585
data-accessor,
@@ -98,7 +98,6 @@ test-suite ExchangeTests
9898
QuickCheck >= 2.4,
9999
test-framework-quickcheck2,
100100
transformers,
101-
rematch >= 0.2.0.0,
102101
ghc-prim
103102
hs-source-dirs:
104103
tests
@@ -120,7 +119,7 @@ test-suite MailboxTests
120119
distributed-process,
121120
distributed-process-execution,
122121
distributed-process-extras,
123-
distributed-process-systest >= 0.1.1 && < 0.4,
122+
distributed-process-systest ^>= 0.4,
124123
distributed-static,
125124
bytestring,
126125
data-accessor,
@@ -139,7 +138,6 @@ test-suite MailboxTests
139138
QuickCheck >= 2.4,
140139
test-framework-quickcheck2,
141140
transformers,
142-
rematch >= 0.2.0.0,
143141
ghc-prim
144142
hs-source-dirs:
145143
tests

packages/distributed-process-execution/tests/TestExchange.hs

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import qualified Control.Distributed.Process.Execution.EventManager as EventMana
1818
)
1919
import Control.Distributed.Process.SysTest.Utils
2020
import Control.Monad (void, forM, forever)
21-
import Control.Rematch (equalTo)
2221

2322
import Prelude hiding (drop)
2423
import Network.Transport.TCP
2524
import qualified Network.Transport as NT
2625
import Test.Framework as TF (defaultMain, testGroup, Test)
2726
import Test.Framework.Providers.HUnit
27+
import Test.HUnit (assertEqual, assertBool)
2828

2929
testKeyBasedRouting :: TestResult Bool -> Process ()
3030
testKeyBasedRouting result = do
@@ -67,20 +67,22 @@ testMultipleRoutes result = do
6767
received <- forM (replicate (2 * 3) us) (const $ receiveChanTimeout 1000 rp)
6868

6969
-- all bindings for 'abc' fired correctly
70-
received `shouldContain` Just (p1, Left "Hello")
71-
received `shouldContain` Just (p3, Left "Hello")
72-
received `shouldContain` Just (p1, Right (123 :: Int))
73-
received `shouldContain` Just (p3, Right (123 :: Int))
74-
75-
-- however the bindings for 'def' never fired
76-
received `shouldContain` Nothing
77-
received `shouldNotContain` Just (p2, Left "Hello")
78-
received `shouldNotContain` Just (p2, Right (123 :: Int))
79-
80-
-- none of the bindings should have examined the headers!
81-
received `shouldNotContain` Just (p1, Left "Goodbye")
82-
received `shouldNotContain` Just (p2, Left "Goodbye")
83-
received `shouldNotContain` Just (p3, Left "Goodbye")
70+
liftIO $ do
71+
72+
assertBool mempty $ Just (p1, Left "Hello") `elem` received
73+
assertBool mempty $ Just (p3, Left "Hello") `elem` received
74+
assertBool mempty $ Just (p1, Right (123 :: Int)) `elem` received
75+
assertBool mempty $ Just (p3, Right (123 :: Int)) `elem` received
76+
77+
-- however the bindings for 'def' never fired
78+
assertBool mempty $ Nothing `elem` received
79+
assertBool mempty $ Just (p2, Left "Hello") `notElem` received
80+
assertBool mempty $ Just (p2, Right (123 :: Int)) `notElem` received
81+
82+
-- none of the bindings should have examined the headers!
83+
assertBool mempty $ Just (p1, Left "Goodbye") `notElem` received
84+
assertBool mempty $ Just (p2, Left "Goodbye") `notElem` received
85+
assertBool mempty $ Just (p3, Left "Goodbye") `notElem` received
8486

8587
testHeaderBasedRouting :: TestResult () -> Process ()
8688
testHeaderBasedRouting result = do
@@ -110,14 +112,16 @@ testHeaderBasedRouting result = do
110112
received <- forM (replicate 5 us) (const $ receiveChanTimeout 1000 rp)
111113

112114
-- all bindings fired correctly
113-
received `shouldContain` Just (p1, Left "Hello")
114-
received `shouldContain` Just (p1, Right (123 :: Int))
115-
received `shouldContain` Just (p2, Right (456 :: Int))
116-
received `shouldContain` Just (p2, Right (789 :: Int))
117-
received `shouldContain` Nothing
115+
liftIO $ do
116+
assertBool mempty $ Just (p1, Left "Hello") `elem` received
117+
assertBool mempty $ Just (p1, Left "Hello") `elem` received
118+
assertBool mempty $ Just (p1, Right (123 :: Int)) `elem` received
119+
assertBool mempty $ Just (p2, Right (456 :: Int)) `elem` received
120+
assertBool mempty $ Just (p2, Right (789 :: Int)) `elem` received
121+
assertBool mempty $ Nothing `elem` received
118122

119123
-- simple check that no other bindings have fired
120-
length received `shouldBe` equalTo (5 :: Int)
124+
liftIO $ assertEqual mempty 5 (length received)
121125

122126
testSimpleEventHandling :: TestResult Bool -> Process ()
123127
testSimpleEventHandling result = do

packages/distributed-process-execution/tests/TestMailbox.hs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ import Control.Distributed.Process.Extras.Time
1313
import Control.Distributed.Process.Extras.Timer
1414
import Control.Distributed.Process.SysTest.Utils
1515

16-
17-
import Control.Rematch (equalTo)
18-
1916
import Prelude hiding (drop)
2017

2118
import Data.Maybe (catMaybes)
2219

2320
import Test.Framework as TF (defaultMain, testGroup, Test)
2421
import Test.Framework.Providers.HUnit
22+
import Test.HUnit (assertEqual)
2523

2624
import qualified MailboxTestFilters (__remoteTable)
2725
import MailboxTestFilters (myFilter, intFilter)
@@ -77,9 +75,10 @@ bufferLimiting buffT result = do
7775
MailboxStats{ pendingMessages = pending'
7876
, droppedMessages = dropped'
7977
, currentLimit = limit' } <- statistics mbox
80-
pending' `shouldBe` equalTo 4
81-
dropped' `shouldBe` equalTo 3
82-
limit' `shouldBe` equalTo 4
78+
liftIO $ do
79+
assertEqual mempty 4 pending'
80+
assertEqual mempty 3 dropped'
81+
assertEqual mempty 4 limit'
8382

8483
active mbox acceptEverything
8584
Just Delivery{ messages = recvd

0 commit comments

Comments
 (0)