From 29f120206e16f80176a0cb309162cc7f889be0b0 Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 4 Apr 2015 16:33:12 +0200 Subject: Added block cache delete method --- core/block_cache_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'core/block_cache_test.go') diff --git a/core/block_cache_test.go b/core/block_cache_test.go index d4f610b71..434b97792 100644 --- a/core/block_cache_test.go +++ b/core/block_cache_test.go @@ -46,3 +46,15 @@ func TestInclusion(t *testing.T) { } } } + +func TestDeletion(t *testing.T) { + chain := newChain(3) + cache := NewBlockCache(3) + insertChainCache(cache, chain) + + cache.Delete(chain[1].Hash()) + + if cache.Has(chain[1].Hash()) { + t.Errorf("expected %x not to be included") + } +} -- cgit v1.2.3