testutil

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2018 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("timed out")

ErrTimeout is returned when time is up

Functions

func CleanupPath

func CleanupPath(t *testing.T, path string)

CleanupPath detects the existence of test DB file and removes it if found

func ConstructAddress

func ConstructAddress(pubkey, prikey string) *iotxaddress.Address

ConstructAddress constructs an iotex address

func SignalChan

func SignalChan(interval, timeout time.Duration) <-chan struct{}

SignalChan returns a channel that will be written every interval until timeout

func WaitUntil

func WaitUntil(interval, timeout time.Duration, f CheckCondition) error

WaitUntil periodically checks whether the condition specified in CheckCondition function is satisfied If an error is returned, it either comes from CheckCondition function or time is up before the given condition is satisfied

Types

type CheckCondition

type CheckCondition func() (bool, error)

CheckCondition defines a func type that checks whether a certain condition is satisfied

Jump to

Keyboard shortcuts

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