(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestNewLRUExpireCache1(t *testing.T) { |
| 11 | contractLookupCache := NewLRUExpireCache(3) |
| 12 | forceLiveLookupTTL := 1 * time.Second |
| 13 | contractLookupCache.Add("key1", true, forceLiveLookupTTL) |
| 14 | v1, gotIt := contractLookupCache.Get("key1") |
| 15 | assert.True(t, gotIt) |
| 16 | assert.NotNil(t, v1) |
| 17 | |
| 18 | time.Sleep(1 * time.Second) |
| 19 | v1, gotIt = contractLookupCache.Get("key1") |
| 20 | assert.False(t, gotIt) |
| 21 | assert.Nil(t, v1) |
| 22 | } |
| 23 | |
| 24 | func TestNewLRUExpireCache2(t *testing.T) { |
| 25 | contractLookupCache := NewLRUExpireCache(3) |
nothing calls this directly
no test coverage detected