timetest

package
v3.42.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SingleTimerStub

type SingleTimerStub struct {
	TimerStub
	Cleanup func()
}

func StubSingleTimer

func StubSingleTimer(t testing.TB) *SingleTimerStub

type Timer

type Timer struct {
	Ch      <-chan time.Time
	OnReset func(time.Duration) bool
	OnStop  func() bool
}

func (Timer) C

func (t Timer) C() <-chan time.Time

func (Timer) Reset

func (t Timer) Reset(d time.Duration) bool

func (Timer) Stop

func (t Timer) Stop() bool

type TimerStub

type TimerStub struct {
	C       chan time.Time
	Created chan time.Duration
	Reset   chan time.Duration
	// contains filtered or unexported fields
}

func (*TimerStub) Init

func (t *TimerStub) Init() (success bool)

type TimerStubs

type TimerStubs map[string]*TimerStub

func StubTimers

func StubTimers(t *testing.T, callers ...string) (ts TimerStubs, cleanup func())

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL