add tests for entry deletion from cache

This commit is contained in:
Trolli Schmittlauch 2020-04-17 17:23:30 +02:00
parent c1f8ec2c56
commit bba14f6be3

View file

@ -107,6 +107,11 @@ spec = do
cacheWithProxyNodeEntry <- addCacheEntry maxNode 0 =<< newCache cacheWithProxyNodeEntry <- addCacheEntry maxNode 0 =<< newCache
nid. cacheGetNodeStateUnvalidated <$> cacheLookupPred (exampleID - 2) cacheWithProxyNodeEntry `shouldBe` Just maxBound nid. cacheGetNodeStateUnvalidated <$> cacheLookupPred (exampleID - 2) cacheWithProxyNodeEntry `shouldBe` Just maxBound
nid. cacheGetNodeStateUnvalidated <$> cacheLookupSucc (anotherID + 2) cacheWithProxyNodeEntry `shouldBe` Just maxBound nid. cacheGetNodeStateUnvalidated <$> cacheLookupSucc (anotherID + 2) cacheWithProxyNodeEntry `shouldBe` Just maxBound
it "entries can be deleted" $ do
nC <- addCacheEntry maxNode 0 =<< newCache
let nc' = deleteCacheEntry maxBound . deleteCacheEntry anotherID $ nC
cacheLookup anotherID nc' `shouldBe` Nothing
cacheLookup maxBound nc' `shouldBe` Nothing
describe "NodeCache query lookup" $ do describe "NodeCache query lookup" $ do