From 21e1fdde98a2e263bf8dfc34a2545b0635e358c8 Mon Sep 17 00:00:00 2001 From: joe Date: Sat, 21 Jan 2017 19:38:06 -0500 Subject: Routing table is idempotent test. --- tests/Network/BitTorrent/DHT/RoutingSpec.hs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'tests/Network/BitTorrent/DHT') diff --git a/tests/Network/BitTorrent/DHT/RoutingSpec.hs b/tests/Network/BitTorrent/DHT/RoutingSpec.hs index 6c0caad5..07a906ba 100644 --- a/tests/Network/BitTorrent/DHT/RoutingSpec.hs +++ b/tests/Network/BitTorrent/DHT/RoutingSpec.hs @@ -69,12 +69,9 @@ spec = do let justOnce x = L.length (L.filter (L.elem x) xss) == 1 L.all justOnce (L.concat xss) - it "insert is idemponent" $ do - pending -{- - property $ \ (e :: Env Int) n t -> do - - let t1 = runSimulation e (T.insert n t) - let t2 = runSimulation e (T.insert n t >>= T.insert n) + it "insert is idemponent" $ property $ \ (e :: Env Int) n t -> do + let ins :: NodeInfo Int -> Table Int -> Routing Int (Table Int) + ins n t = snd <$> T.insert (currentTime e) (TryInsert n) t + let t1 = runSimulation e (ins n t) + let t2 = runSimulation e (ins n t >>= ins n) t1 `shouldBe` t2 --} -- cgit v1.2.3