summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/Network/BitTorrent/DHT/RoutingSpec.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/Network/BitTorrent/DHT/RoutingSpec.hs b/tests/Network/BitTorrent/DHT/RoutingSpec.hs
index 651412cf..788c4341 100644
--- a/tests/Network/BitTorrent/DHT/RoutingSpec.hs
+++ b/tests/Network/BitTorrent/DHT/RoutingSpec.hs
@@ -31,9 +31,9 @@ runSimulation e m = evalState (runRouting ping closest timestamp m) e
31 timestamp = gets currentTime 31 timestamp = gets currentTime
32 32
33instance Arbitrary ip => Arbitrary (Env ip) where 33instance Arbitrary ip => Arbitrary (Env ip) where
34 arbitrary = Env <$> arbitrary <*> (L.take nodeLimit <$> arbitrary) 34 arbitrary = Env <$> arbitrary <*> (vector nodeCount)
35 where 35 where
36 nodeLimit = 1000 36 nodeCount = 1000
37 37
38instance (Arbitrary ip, Eq ip) => Arbitrary (Table ip) where 38instance (Arbitrary ip, Eq ip) => Arbitrary (Table ip) where
39 arbitrary = do 39 arbitrary = do
@@ -65,7 +65,12 @@ spec = do
65 let justOnce x = L.length (L.filter (L.elem x) xss) == 1 65 let justOnce x = L.length (L.filter (L.elem x) xss) == 1
66 L.all justOnce (L.concat xss) 66 L.all justOnce (L.concat xss)
67 67
68 it "insert is idemponent" $ property $ \ (e :: Env Int) n t -> do 68 it "insert is idemponent" $ do
69 pending
70{-
71 property $ \ (e :: Env Int) n t -> do
72
69 let t1 = runSimulation e (T.insert n t) 73 let t1 = runSimulation e (T.insert n t)
70 let t2 = runSimulation e (T.insert n t >>= T.insert n) 74 let t2 = runSimulation e (T.insert n t >>= T.insert n)
71 t1 `shouldBe` t2 \ No newline at end of file 75 t1 `shouldBe` t2
76-} \ No newline at end of file