(b *testing.B)
| 1664 | } |
| 1665 | |
| 1666 | func BenchmarkDeleteExpiredLoop(b *testing.B) { |
| 1667 | b.StopTimer() |
| 1668 | tc := New(5*time.Minute, 0) |
| 1669 | tc.mu.Lock() |
| 1670 | for i := 0; i < 100000; i++ { |
| 1671 | tc.set(strconv.Itoa(i), "bar", DefaultExpiration) |
| 1672 | } |
| 1673 | tc.mu.Unlock() |
| 1674 | b.StartTimer() |
| 1675 | for i := 0; i < b.N; i++ { |
| 1676 | tc.DeleteExpired() |
| 1677 | } |
| 1678 | } |
| 1679 | |
| 1680 | func TestGetWithExpiration(t *testing.T) { |
| 1681 | tc := New(DefaultExpiration, 0) |
nothing calls this directly
no test coverage detected
searching dependent graphs…