Skip to content

Commit

Permalink
refactor(runtime): move transport test to testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed May 7, 2021
1 parent acde0a8 commit 14e7a6e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/runtime-prototype/stunt-double.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ test-suite test
, tasty-hunit

other-modules:
StuntDouble.EventLoop.TransportTest
StuntDouble.EventLoopTest
TastyDiscover

Expand Down
18 changes: 18 additions & 0 deletions src/runtime-prototype/test/StuntDouble/EventLoop/TransportTest.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module StuntDouble.EventLoop.TransportTest where

import Control.Concurrent.Async
import Test.HUnit

import StuntDouble.EventLoop.Transport
import StuntDouble

------------------------------------------------------------------------

unit_sendReceive :: IO ()
unit_sendReceive = do
t <- namedPipeTransport "/tmp" (EventLoopName "a")
let e = Envelope RequestKind (RemoteRef "from" 0) (Message "msg") (RemoteRef "a" 1) 0
a <- async (transportSend t e)
e' <- transportReceive t
cancel a
e' @?= e

0 comments on commit 14e7a6e

Please sign in to comment.