Skip to content

Commit

Permalink
expand test for purging a entry
Browse files Browse the repository at this point in the history
  • Loading branch information
denge90 committed Aug 1, 2016
1 parent a878577 commit a69bb12
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,16 @@ func Test_Cache_PurgeEntries(t *testing.T) {
a := assert.New(t)

c := NewCache("my-cache", 100, 100, time.Millisecond)
c.Set("hashString", "", 1, nil)
c.Set("hashStringToPurge", "", 1, nil)
c.Set("hashStringToStay", "", 1, nil)

c.PurgeEntries([]string{"hashString"})
_, foundInCache := c.Get("hashString")
c.PurgeEntries([]string{"hashStringToPurge"})

a.False(foundInCache)
_, foundInCachePurge := c.Get("hashStringToPurge")
_, foundInCacheStay := c.Get("hashStringToStay")

a.False(foundInCachePurge)
a.True(foundInCacheStay)
}

func Test_Cache_Invalidation(t *testing.T) {
Expand Down

0 comments on commit a69bb12

Please sign in to comment.