summaryrefslogtreecommitdiff
path: root/tests/Network/BitTorrent/DHT/RoutingSpec.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Network/BitTorrent/DHT/RoutingSpec.hs')
-rw-r--r--tests/Network/BitTorrent/DHT/RoutingSpec.hs15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/Network/BitTorrent/DHT/RoutingSpec.hs b/tests/Network/BitTorrent/DHT/RoutingSpec.hs
index 3077a52a..6c0caad5 100644
--- a/tests/Network/BitTorrent/DHT/RoutingSpec.hs
+++ b/tests/Network/BitTorrent/DHT/RoutingSpec.hs
@@ -46,14 +46,17 @@ instance (Arbitrary ip, Eq ip) => Arbitrary (Table ip) where
46-- nodes <- vector nodeN 46-- nodes <- vector nodeN
47 47
48 node <- arbitrary 48 node <- arbitrary
49 mt <- runSimulation <$> arbitrary 49 mt <- do
50 <*> pure (T.insert node table) 50 env <- arbitrary
51 return $ runSimulation env $ do
52 (_,t') <- T.insert (currentTime env) (TryInsert node) table
53 return t' :: Routing ip (Table ip)
51 --(foldM (flip fillTable) table nodes) 54 --(foldM (flip fillTable) table nodes)
52 return (fromJust mt) 55 return (fromJust mt)
53 where 56-- where
54 fillTable x t = do 57-- fillTable x t = do
55 t' <- T.insert x t 58-- t' <- T.insert x t
56 return $ if T.full t' then t else t' 59-- return $ if T.full t' then t else t'
57 60
58spec :: Spec 61spec :: Spec
59spec = do 62spec = do