(t *testing.T)
| 99 | } |
| 100 | |
| 101 | func Test_lockMap_WaitOrLock(t *testing.T) { |
| 102 | m := newMap(sweepInterval) |
| 103 | |
| 104 | promise, gotLock := m.WaitOrLock(1, ttl) |
| 105 | assert.True(t, gotLock) |
| 106 | |
| 107 | stored, gotLock := m.WaitOrLock(1, ttl) |
| 108 | assert.False(t, gotLock) |
| 109 | assert.Equal(t, promise, stored) |
| 110 | |
| 111 | assertNotResolved(promise) |
| 112 | } |
| 113 | |
| 114 | func Test_lockMap_sweep(t *testing.T) { |
| 115 | sweep := ttl * 3 / 2 |
nothing calls this directly
no test coverage detected