From 05c8b5b294eb902a3930c6072ec74381e79f47e8 Mon Sep 17 00:00:00 2001 From: anvil-of-fury Date: Sun, 21 Mar 2021 02:27:58 +0000 Subject: [PATCH] golang lint reformatting applied --- d2common/d2cache/cache_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/d2common/d2cache/cache_test.go b/d2common/d2cache/cache_test.go index c1474b54..ad306f74 100644 --- a/d2common/d2cache/cache_test.go +++ b/d2common/d2cache/cache_test.go @@ -4,7 +4,6 @@ import ( "testing" ) - func TestCacheInsert(t *testing.T) { cache := CreateCache(1) insertError := cache.Insert("A", "", 1) @@ -13,6 +12,15 @@ func TestCacheInsert(t *testing.T) { } } +// TODO: do we want cache insert to fail if we add a node with weight > budget? +func TestCacheInsertWithinBudget(t *testing.T) { + cache := CreateCache(1) + insertError := cache.Insert("A", "", 2) + if insertError == nil { + t.Fatalf("Cache insert of node weight larger than budget did not result in error") + } +} + func TestCacheInsertUpdatesWeight(t *testing.T) { cache := CreateCache(2) cache.Insert("A", "", 1) @@ -80,4 +88,3 @@ func TestClear(t *testing.T) { t.Fatal("Still able to retrieve nodes after cache was cleared") } } -