Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeClock ¶
type FakeClock struct {
// contains filtered or unexported fields
}
FakeClock is a controllable clock for tests. - Now() returns the current fake time. - NewTimer(d) creates a manual timer that fires when Advance moves time >= now+d. FakeClock is a controllable clock for tests. It also allows observing timer creation to write deterministic "it blocks" assertions without relying on goroutine scheduling luck.
func NewFakeClock ¶
func (*FakeClock) TimersCreated ¶
TimersCreated returns how many timers have been created so far.
func (*FakeClock) WaitForTimersCreated ¶
WaitForTimersCreated blocks until at least n timers have been created.
type ManualTimer ¶
type ManualTimer struct {
// contains filtered or unexported fields
}
func (*ManualTimer) C ¶
func (mt *ManualTimer) C() <-chan time.Time
func (*ManualTimer) Stop ¶
func (mt *ManualTimer) Stop() bool
Click to show internal directories.
Click to hide internal directories.