test

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TypeOfPeerID

func TypeOfPeerID() gomock.Matcher

TypeOfPeerID matches that given argument has the peer.ID type.

func WaitWithTimeout

func WaitWithTimeout(t *testing.T, wg *sync.WaitGroup, timeout <-chan time.Time)

WaitWithTimeout is a testing helper function that will block until the wait group counter is zero. If the timeout ticks before that, it will mark the test as failed and stop the testing process.

func WantError

func WantError(t *testing.T, want string, got error)

WantError assert an error to a given string, if string is empty, it assumes no error case.

func WantErrorContains

func WantErrorContains(t *testing.T, wantContains string, got error)

WantErrorContains assert an error to a given string, if string is empty, it assumes no error case.

Types

type PeerIDMatcher

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

PeerIDMatcher matches given peer.ID to a string

func NewPeerIDMatcher

func NewPeerIDMatcher(val string) *PeerIDMatcher

func (*PeerIDMatcher) Matches

func (m *PeerIDMatcher) Matches(x interface{}) bool

func (*PeerIDMatcher) String

func (m *PeerIDMatcher) String() string

type PeerIDSliceMatcher

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

func NewPeerIDSliceMatcher

func NewPeerIDSliceMatcher(val ...string) *PeerIDSliceMatcher

NewPeerIDSliceMatcher matches given slice of peer.ID to a slice of strings

func (*PeerIDSliceMatcher) Matches

func (m *PeerIDSliceMatcher) Matches(x interface{}) bool

func (*PeerIDSliceMatcher) String

func (m *PeerIDSliceMatcher) String() string

Jump to

Keyboard shortcuts

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