pachyderm: github.com/pachyderm/pachyderm/src/client/pkg/require Index | Files

package require

import "github.com/pachyderm/pachyderm/src/client/pkg/require"

Index

Package Files

require.go

func ElementsEqual Uses

func ElementsEqual(tb testing.TB, expecteds interface{}, actuals interface{}, msgAndArgs ...interface{})

ElementsEqual checks that the elements of the slice "expecteds" are exactly the elements of the slice "actuals", ignoring order (i.e. setwise-equal, but respecting duplicates).

Note that if the elements of 'expecteds' and 'actuals' are pointers, ElementsEqual will unwrap the pointers before comparing them, so that the output of e.g. ListCommit(), which returns []*pfs.Commit can easily be verfied.

Also, treat 'nil' and the empty slice as equivalent, so that callers can pass 'nil' for 'expecteds'.

func ElementsEqualOrErr Uses

func ElementsEqualOrErr(expecteds interface{}, actuals interface{}) error

ElementsEqualOrErr returns nil if the elements of the slice "expecteds" are exactly the elements of the slice "actuals", ignoring order (i.e. setwise-equal), and an error otherwise.

Unlike other require.* functions, this returns an error, so that if the caller is polling e.g. ListCommit or ListAdmins, they can wrap ElementsEqualOrErr in a retry loop.

Also, like ElementsEqual, treat 'nil' and the empty slice as equivalent (for convenience)

func ElementsEqualUnderFn Uses

func ElementsEqualUnderFn(tb testing.TB, expecteds interface{}, actuals interface{}, f func(interface{}) interface{}, msgAndArgs ...interface{})

ElementsEqualUnderFn checks that the elements of the slice 'expecteds' are exactly the images of every element of the slice 'actuals' under 'f', ignoring order (i.e. 'expecteds' and 'map(f, actuals)' are setwise-equal, but respecting duplicates). This is useful for cases where ElementsEqual doesn't quite work, e.g. because the type in 'expecteds'/'actuals' contains a pointer, or 'actuals' contains superfluous data which you wish to discard

Like ElementsEqual, treat 'nil' and the empty slice as equivalent (for convenience)

func Equal Uses

func Equal(tb testing.TB, expected interface{}, actual interface{}, msgAndArgs ...interface{})

Equal checks equality of two values.

func EqualOneOf Uses

func EqualOneOf(tb testing.TB, expecteds interface{}, actual interface{}, msgAndArgs ...interface{})

EqualOneOf checks if a value is equal to one of the elements of a slice. Note that if expecteds and actual are a slice of pointers and a pointer respectively, then the pointers are unwrapped before comparison (so this functions works for e.g. *pfs.Commit and []*pfs.Commit)

func False Uses

func False(tb testing.TB, value bool, msgAndArgs ...interface{})

False checks a value is false.

func Matches Uses

func Matches(tb testing.TB, expectedMatch string, actual string, msgAndArgs ...interface{})

Matches checks that a string matches a regular-expression.

func Nil Uses

func Nil(tb testing.TB, object interface{}, msgAndArgs ...interface{})

Nil checks a value is nil.

func NoError Uses

func NoError(tb testing.TB, err error, msgAndArgs ...interface{})

NoError checks for no error.

func NoErrorWithinT Uses

func NoErrorWithinT(tb testing.TB, t time.Duration, f func() error, msgAndArgs ...interface{})

NoErrorWithinT checks that 'f' finishes within time 't' and does not emit an error

func NoErrorWithinTRetry Uses

func NoErrorWithinTRetry(tb testing.TB, t time.Duration, f func() error, msgAndArgs ...interface{})

NoErrorWithinTRetry checks that 'f' finishes within time 't' and does not emit an error. Unlike NoErrorWithinT if f does error, it will retry it.

func NoneEquals Uses

func NoneEquals(tb testing.TB, expected interface{}, actuals interface{}, msgAndArgs ...interface{})

NoneEquals checks one element of a slice equals a value. Like EqualsOneOf, NoneEquals unwraps pointers.

func NotEqual Uses

func NotEqual(tb testing.TB, expected interface{}, actual interface{}, msgAndArgs ...interface{})

NotEqual checks inequality of two values.

func NotNil Uses

func NotNil(tb testing.TB, object interface{}, msgAndArgs ...interface{})

NotNil checks a value is non-nil.

func OneOfEquals Uses

func OneOfEquals(tb testing.TB, expected interface{}, actuals interface{}, msgAndArgs ...interface{})

OneOfEquals checks whether one element of a slice equals a value. Like EqualsOneOf, OneOfEquals unwraps pointers

func OneOfMatches Uses

func OneOfMatches(tb testing.TB, expectedMatch string, actuals []string, msgAndArgs ...interface{})

OneOfMatches checks whether one element of a slice matches a regular-expression.

func True Uses

func True(tb testing.TB, value bool, msgAndArgs ...interface{})

True checks a value is true.

func YesError Uses

func YesError(tb testing.TB, err error, msgAndArgs ...interface{})

YesError checks for an error.

func YesPanic Uses

func YesPanic(tb testing.TB, cb func(), msgAndArgs ...interface{})

YesPanic checks that the callback panics.

Package require imports 6 packages (graph) and is imported by 5 packages. Updated 2019-06-14. Refresh now. Tools for package owners.