(t *testing.T)
| 83 | } |
| 84 | |
| 85 | func Test_lockMap_Wait(t *testing.T) { |
| 86 | m := newMap(sweepInterval) |
| 87 | promise, gotLock := m.WaitOrLock(1, ttl) |
| 88 | assert.True(t, gotLock) |
| 89 | |
| 90 | stored := m.Wait(1) |
| 91 | assert.Equal(t, promise, stored) |
| 92 | |
| 93 | <-time.After(ttl) |
| 94 | |
| 95 | stored = m.Wait(1) |
| 96 | assert.Nil(t, stored) |
| 97 | |
| 98 | assertResolved(promise) |
| 99 | } |
| 100 | |
| 101 | func Test_lockMap_WaitOrLock(t *testing.T) { |
| 102 | m := newMap(sweepInterval) |
nothing calls this directly
no test coverage detected