Skip to content

Commit 4790859

Browse files
committed
Ported distributed-process-async
1 parent 7dcaf82 commit 4790859

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,11 @@ test-suite AsyncTests
7575
network-transport-tcp >= 0.6 && < 0.9,
7676
binary >= 0.8 && < 0.9,
7777
deepseq >= 1.4 && < 1.7,
78-
-- HUnit >= 1.2 && < 2,
7978
stm >= 2.3 && < 2.6,
80-
test-framework >= 0.6 && < 0.9,
81-
test-framework-hunit,
79+
tasty >= 1.5 && <1.6,
80+
tasty-hunit >=0.10 && <0.11,
8281
transformers
83-
hs-source-dirs:
84-
tests
82+
hs-source-dirs: tests
8583
default-language: Haskell2010
8684
ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
8785
default-extensions: CPP

packages/distributed-process-async/tests/TestAsync.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import Data.Typeable()
1717
import Network.Transport.TCP
1818
import qualified Network.Transport as NT
1919

20-
import Test.Framework (Test, testGroup, defaultMain)
21-
import Test.Framework.Providers.HUnit (testCase)
20+
import Test.Tasty(TestTree, testGroup, defaultMain)
21+
import Test.Tasty.HUnit (testCase)
2222

2323
testAsyncPoll :: TestResult (AsyncResult ()) -> Process ()
2424
testAsyncPoll result = do
@@ -158,8 +158,8 @@ testAsyncRecursive result = do
158158
myNode <- getSelfNode
159159
fib (myNode,6) >>= stash result
160160

161-
tests :: LocalNode -> [Test]
162-
tests localNode = [
161+
tests :: LocalNode -> TestTree
162+
tests localNode = testGroup "" [
163163
testGroup "Handling async results with STM" [
164164
testCase "testAsyncCancel"
165165
(delayedAssertion
@@ -210,14 +210,14 @@ tests localNode = [
210210
]
211211
]
212212

213-
asyncStmTests :: NT.Transport -> IO [Test]
213+
asyncStmTests :: NT.Transport -> IO TestTree
214214
asyncStmTests transport = do
215215
localNode <- newLocalNode transport $ __remoteTableDecl initRemoteTable
216216
let testData = tests localNode
217217
return testData
218218

219219
-- | Given a @builder@ function, make and run a test suite on a single transport
220-
testMain :: (NT.Transport -> IO [Test]) -> IO ()
220+
testMain :: (NT.Transport -> IO TestTree) -> IO ()
221221
testMain builder = do
222222
Right (transport, _) <- createTransportExposeInternals (defaultTCPAddr "127.0.0.1" "0") defaultTCPParameters
223223
testData <- builder transport

0 commit comments

Comments
 (0)