From e9441b12e0692f1420509316d661dc731be11a28 Mon Sep 17 00:00:00 2001 From: Patrick Mylund Nielsen Date: Sat, 28 Nov 2015 12:22:52 -0500 Subject: [PATCH] Add mutex-using test condition to TestOnEvicted --- cache_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cache_test.go b/cache_test.go index c357cb0..13f17ae 100644 --- a/cache_test.go +++ b/cache_test.go @@ -1235,11 +1235,16 @@ func TestOnEvicted(t *testing.T) { if k == "foo" && v.(int) == 3 { works = true } + tc.Set("bar", 4, DefaultExpiration) }) tc.Delete("foo") + x, _ := tc.Get("bar") if !works { t.Error("works bool not true") } + if x.(int) != 4 { + t.Error("bar was not 4") + } } func TestCacheSerialization(t *testing.T) {