testutil

package
v0.0.0-...-1c52b4b Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNatsServer

func NewNatsServer(port int) *server.Server

func ShutdownNatsServer

func ShutdownNatsServer(s *server.Server)

Types

type Clock

type Clock struct {
	Start time.Time
	// contains filtered or unexported fields
}

Clock implements clock.Clock, but each call to Now() will increment a counter. The subsequent call will be the start time incremented by the specified unit. For example, increment by one minute at a time.

func NewClock

func NewClock(unit time.Duration) *Clock

func (*Clock) Add

func (c *Clock) Add(d time.Duration) time.Time

func (*Clock) Last

func (c *Clock) Last() time.Time

Last returns the last time that was used.

func (*Clock) Now

func (c *Clock) Now() time.Time

Now implements clock.Clock.

type Gen

type Gen interface {
	New() string
}

type IDGen

type IDGen struct {
	// contains filtered or unexported fields
}

IDGen wraps another id.Gen but remembers the last ID that was generated in order to make assertions.

func NewIDGen

func NewIDGen(gen Gen) *IDGen

func (*IDGen) Last

func (s *IDGen) Last() string

Last returns the last ID that was generated.

func (*IDGen) New

func (s *IDGen) New() string

New implements the id.Gen interface.

type Is

type Is struct {
	// contains filtered or unexported fields
}

func NewIs

func NewIs(t *testing.T) *Is

func (*Is) Equal

func (is *Is) Equal(a, b any)

func (*Is) Err

func (is *Is) Err(err error, baseErr error)

func (*Is) NoErr

func (is *Is) NoErr(err error)

func (*Is) True

func (is *Is) True(t bool)

Jump to

Keyboard shortcuts

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