diff options
-rw-r--r-- | bittorrent.cabal | 3 | ||||
-rw-r--r-- | tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/bittorrent.cabal b/bittorrent.cabal index e4752c13..a398dd6d 100644 --- a/bittorrent.cabal +++ b/bittorrent.cabal | |||
@@ -209,6 +209,9 @@ test-suite spec | |||
209 | System.Torrent.FileMapSpec | 209 | System.Torrent.FileMapSpec |
210 | build-depends: base == 4.* | 210 | build-depends: base == 4.* |
211 | 211 | ||
212 | -- * Concurrency | ||
213 | , async | ||
214 | |||
212 | -- * Data | 215 | -- * Data |
213 | , bytestring | 216 | , bytestring |
214 | , containers | 217 | , containers |
diff --git a/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs b/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs index fd7d1232..3ecc139d 100644 --- a/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs +++ b/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs | |||
@@ -1,6 +1,6 @@ | |||
1 | {-# LANGUAGE RecordWildCards #-} | 1 | {-# LANGUAGE RecordWildCards #-} |
2 | module Network.BitTorrent.Tracker.RPC.UDPSpec (spec, trackerURIs) where | 2 | module Network.BitTorrent.Tracker.RPC.UDPSpec (spec, trackerURIs) where |
3 | 3 | import Control.Concurrent.Async | |
4 | import Control.Monad | 4 | import Control.Monad |
5 | import Data.Default | 5 | import Data.Default |
6 | import Data.List as L | 6 | import Data.List as L |
@@ -47,3 +47,9 @@ spec = parallel $ do | |||
47 | withManager def $ \ mgr -> do | 47 | withManager def $ \ mgr -> do |
48 | xs <- scrape mgr uri [def] | 48 | xs <- scrape mgr uri [def] |
49 | L.length xs `shouldSatisfy` (>= 1) | 49 | L.length xs `shouldSatisfy` (>= 1) |
50 | |||
51 | describe "Manager" $ do | ||
52 | it "should handle arbitrary intermixed concurrent queries" $ do | ||
53 | withManager def $ \ mgr -> do | ||
54 | _ <- mapConcurrently (\ _ -> scrape mgr uri [def]) [1..100] | ||
55 | return () \ No newline at end of file | ||