test

package
v0.0.0-...-a4f63c7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertAddressesEqual

func AssertAddressesEqual(t *testing.T, exp, act []ma.Multiaddr)

func AssertNilError

func AssertNilError(t *testing.T, err error)

func ExpectError

func ExpectError(t *testing.T, err error, msg string)

func GenerateTestAddrs

func GenerateTestAddrs(n int) []ma.Multiaddr

func RandPeerID

func RandPeerID() (peer.ID, error)

func RandPeerIDFatal

func RandPeerIDFatal(t testing.TB) peer.ID

func RandTestKeyPair

func RandTestKeyPair(typ, bits int) (ci.PrivKey, ci.PubKey, error)

func SeededTestKeyPair

func SeededTestKeyPair(typ, bits int, seed int64) (ci.PrivKey, ci.PubKey, error)

Types

type MockClock

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

func NewMockClock

func NewMockClock() *MockClock

func (*MockClock) AdvanceBy

func (c *MockClock) AdvanceBy(dur time.Duration)

func (*MockClock) InstantTimer

func (c *MockClock) InstantTimer(when time.Time) *mockInstantTimer

func (*MockClock) Now

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

func (*MockClock) Since

func (c *MockClock) Since(t time.Time) time.Duration

Since implements autorelay.ClockWithInstantTimer

Jump to

Keyboard shortcuts

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