Skip to content

Commit e9441b1

Browse files
committed
Add mutex-using test condition to TestOnEvicted
1 parent 3f2c810 commit e9441b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cache_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,11 +1235,16 @@ func TestOnEvicted(t *testing.T) {
12351235
if k == "foo" && v.(int) == 3 {
12361236
works = true
12371237
}
1238+
tc.Set("bar", 4, DefaultExpiration)
12381239
})
12391240
tc.Delete("foo")
1241+
x, _ := tc.Get("bar")
12401242
if !works {
12411243
t.Error("works bool not true")
12421244
}
1245+
if x.(int) != 4 {
1246+
t.Error("bar was not 4")
1247+
}
12431248
}
12441249

12451250
func TestCacheSerialization(t *testing.T) {

0 commit comments

Comments
 (0)