Add mutex-using test condition to TestOnEvicted

This commit is contained in:
Patrick Mylund Nielsen 2015-11-28 12:22:52 -05:00
parent 3f2c810ea1
commit e9441b12e0
1 changed files with 5 additions and 0 deletions

View File

@ -1235,11 +1235,16 @@ func TestOnEvicted(t *testing.T) {
if k == "foo" && v.(int) == 3 { if k == "foo" && v.(int) == 3 {
works = true works = true
} }
tc.Set("bar", 4, DefaultExpiration)
}) })
tc.Delete("foo") tc.Delete("foo")
x, _ := tc.Get("bar")
if !works { if !works {
t.Error("works bool not true") t.Error("works bool not true")
} }
if x.(int) != 4 {
t.Error("bar was not 4")
}
} }
func TestCacheSerialization(t *testing.T) { func TestCacheSerialization(t *testing.T) {