This commit is contained in:
Tan Jiang 2017-07-12 16:48:57 +08:00
parent 436f0efab8
commit 7fdb77f6d2

View File

@ -26,13 +26,14 @@ func TestTimeMarker(t *testing.T) {
m := &TimeMarker{
interval: 1 * time.Second,
}
r1 := m.Mark()
r1 := m.Check()
assert.True(r1)
r2 := m.Mark()
m.Mark()
r2 := m.Check()
assert.False(r2)
t.Log("Sleep for 2 seconds...")
time.Sleep(2 * time.Second)
r3 := m.Mark()
r3 := m.Check()
assert.True(r3)
}