summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Network/KRPCSpec.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/Network/KRPCSpec.hs b/tests/Network/KRPCSpec.hs
index 0a6dc8fb..eabcc817 100644
--- a/tests/Network/KRPCSpec.hs
+++ b/tests/Network/KRPCSpec.hs
@@ -25,6 +25,9 @@ opts = def { optQueryTimeout = 1 }
25 25
26spec :: Spec 26spec :: Spec
27spec = do 27spec = do
28 let qr :: MonadKRPC h m => SockAddr -> Echo Int -> m (Echo Int)
29 qr = query
30
28 describe "manager" $ do 31 describe "manager" $ do
29 it "is active until closeManager called" $ do 32 it "is active until closeManager called" $ do
30 m <- newManager opts servAddr [] 33 m <- newManager opts servAddr []
@@ -43,14 +46,14 @@ spec = do
43 it "count transactions properly" $ do 46 it "count transactions properly" $ do
44 (withManager opts servAddr handlers $ runReaderT $ do 47 (withManager opts servAddr handlers $ runReaderT $ do
45 listen 48 listen
46 _ <- query servAddr (Echo (0xabcd :: Int)) 49 _ <- qr servAddr (Echo 0xabcd)
47 _ <- query servAddr (Echo (0xabcd :: Int)) 50 _ <- qr servAddr (Echo 0xabcd)
48 getQueryCount 51 getQueryCount
49 ) 52 )
50 `shouldReturn` 2 53 `shouldReturn` 2
51 54
52 it "throw timeout exception" $ do 55 it "throw timeout exception" $ do
53 (withManager opts servAddr handlers $ runReaderT $ do 56 (withManager opts servAddr handlers $ runReaderT $ do
54 query servAddr (Echo (0xabcd :: Int)) 57 qr servAddr (Echo 0xabcd)
55 ) 58 )
56 `shouldThrow` (== TimeoutExpired) 59 `shouldThrow` (== TimeoutExpired)