testutils

package
v0.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Calling added in v0.3.0

func Calling[T any](o T, err error) result[T]

func Close

func Close(c io.Closer, msg ...interface{})

func Defer

func Defer(f func() error, msg ...interface{})

func Must

func Must[T any](o T, err error) T

func MustBeNonNil

func MustBeNonNil[T any](o T) T

func MustBeSuccessful

func MustBeSuccessful(err error)

func MustFailWithMessage

func MustFailWithMessage(err error, msg string)

func MustWithOffset

func MustWithOffset[T any](offset int, res result[T]) T

func R added in v0.3.0

func R[T any](o T, err error) result[T]

func StringEqualTrimmedWithContext

func StringEqualTrimmedWithContext(expected string, subst ...map[string]string) types.GomegaMatcher

StringEqualTrimmedWithContext compares two trimmed strings and provides the complete actual value as error context. If value mappings are given, the expected string is evaluated by envsubst, first. It is an error for actual to be nil. Use BeNil() instead.

func StringEqualWithContext

func StringEqualWithContext(expected string, subst ...map[string]string) types.GomegaMatcher

StringEqualWithContext compares two strings and provides the complete actual value as error context. If value mappings are given, the expected string is evaluated by envsubst, first. It is an error for actual to be nil. Use BeNil() instead.

Types

type StringEqualMatcher

type StringEqualMatcher struct {
	Expected string
	Trim     bool
}

func (*StringEqualMatcher) FailureMessage

func (matcher *StringEqualMatcher) FailureMessage(actual interface{}) (message string)

func (*StringEqualMatcher) Match

func (matcher *StringEqualMatcher) Match(actual interface{}) (success bool, err error)

func (*StringEqualMatcher) NegatedFailureMessage

func (matcher *StringEqualMatcher) NegatedFailureMessage(actual interface{}) (message string)

Jump to

Keyboard shortcuts

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