tests

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActualFormatKey = "%actual%"
)
View Source
const (
	ValidateSuccess string = "__success__"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Capture

type Capture[CaptureType any] struct {
	Context[CaptureType]

	Value CaptureType
}

type Context

type Context[CaptureType any] struct {
	// contains filtered or unexported fields
}

func Empty added in v0.1.2

func Empty(tb testing.TB) Context[interface{}]

func EmptyT added in v0.1.2

func EmptyT[CaptureType any](tb testing.TB) Context[CaptureType]

func ExecFn

func ExecFn(tb testing.TB, function any, args ...any) Context[interface{}]

func ExecFnT

func ExecFnT[CaptureType any](tb testing.TB, function any, args ...any) Context[CaptureType]

func Switch

func Switch[CaptureType any](ctx Context[interface{}]) Context[CaptureType]

func SwitchT

func SwitchT[OriginalCaptureType, CaptureType any](ctx Context[OriginalCaptureType]) Context[CaptureType]

func Value added in v0.1.3

func Value[CaptureType any](tb testing.TB, value CaptureType) Context[CaptureType]

func (Context[CaptureType]) Capture

func (ctx Context[CaptureType]) Capture() (Capture[CaptureType], Context[CaptureType])

func (Context[CaptureType]) CaptureError

func (ctx Context[CaptureType]) CaptureError() (Capture[error], Context[CaptureType])

func (Context[CaptureType]) CaptureObject added in v0.1.2

func (ctx Context[CaptureType]) CaptureObject() (Capture[objects.Object], Context[CaptureType])

func (Context[CaptureType]) Collect added in v0.1.2

func (ctx Context[CaptureType]) Collect(args ...any) Context[CaptureType]

func (Context[CaptureType]) Empty added in v0.1.3

func (ctx Context[CaptureType]) Empty() Context[CaptureType]

func (Context[CaptureType]) Emptyf added in v0.1.3

func (ctx Context[CaptureType]) Emptyf(format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) Equals

func (ctx Context[CaptureType]) Equals(expected any) Context[CaptureType]

func (Context[CaptureType]) Equalsf

func (ctx Context[CaptureType]) Equalsf(expected any, format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) Error

func (ctx Context[CaptureType]) Error() Context[CaptureType]

func (Context[CaptureType]) ErrorCode added in v0.1.2

func (ctx Context[CaptureType]) ErrorCode(code errors.ErrorCode) Context[CaptureType]

func (Context[CaptureType]) ErrorCodef added in v0.1.2

func (ctx Context[CaptureType]) ErrorCodef(code errors.ErrorCode, format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) ErrorContainsObject added in v0.1.2

func (ctx Context[CaptureType]) ErrorContainsObject(expected objects.Object) Context[CaptureType]

func (Context[CaptureType]) ErrorContainsObjectf added in v0.1.2

func (ctx Context[CaptureType]) ErrorContainsObjectf(expected objects.Object, format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) ErrorMatches

func (ctx Context[CaptureType]) ErrorMatches(expected string) Context[CaptureType]

func (Context[CaptureType]) ErrorMatchesf

func (ctx Context[CaptureType]) ErrorMatchesf(expected string, format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) Errorf

func (ctx Context[CaptureType]) Errorf(format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) False added in v0.1.1

func (ctx Context[CaptureType]) False() Context[CaptureType]

func (Context[CaptureType]) Falsef added in v0.1.1

func (ctx Context[CaptureType]) Falsef(format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) Fatal

func (ctx Context[CaptureType]) Fatal() Context[CaptureType]

func (Context[CaptureType]) Flatten added in v0.1.2

func (ctx Context[CaptureType]) Flatten() Context[CaptureType]

func (Context[CaptureType]) IsNil

func (ctx Context[CaptureType]) IsNil() Context[CaptureType]

func (Context[CaptureType]) IsNilf

func (ctx Context[CaptureType]) IsNilf(format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) IsNotNil

func (ctx Context[CaptureType]) IsNotNil() Context[CaptureType]

func (Context[CaptureType]) IsNotNilf

func (ctx Context[CaptureType]) IsNotNilf(format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) Len added in v0.1.2

func (ctx Context[CaptureType]) Len(expected int) Context[CaptureType]

func (Context[CaptureType]) Lenf added in v0.1.2

func (ctx Context[CaptureType]) Lenf(expected int, format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) NoError

func (ctx Context[CaptureType]) NoError() Context[CaptureType]

func (Context[CaptureType]) NoErrorf

func (ctx Context[CaptureType]) NoErrorf(format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) NonFatal

func (ctx Context[CaptureType]) NonFatal() Context[CaptureType]

func (Context[CaptureType]) NotEmpty added in v0.1.3

func (ctx Context[CaptureType]) NotEmpty() Context[CaptureType]

func (Context[CaptureType]) NotEmptyf added in v0.1.3

func (ctx Context[CaptureType]) NotEmptyf(format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) ObjectEquals added in v0.1.2

func (ctx Context[CaptureType]) ObjectEquals(expected any) Context[CaptureType]

func (Context[CaptureType]) ObjectEqualsf added in v0.1.2

func (ctx Context[CaptureType]) ObjectEqualsf(expected any, format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) Skip

func (ctx Context[CaptureType]) Skip() Context[CaptureType]

func (Context[CaptureType]) True added in v0.1.1

func (ctx Context[CaptureType]) True() Context[CaptureType]

func (Context[CaptureType]) Truef added in v0.1.1

func (ctx Context[CaptureType]) Truef(format string, args ...any) Context[CaptureType]

func (Context[CaptureType]) Validate

func (ctx Context[CaptureType]) Validate(validate ValidateFn[CaptureType]) Context[CaptureType]

func (Context[CaptureType]) Validatef

func (ctx Context[CaptureType]) Validatef(validate ValidateFnf[CaptureType]) Context[CaptureType]

type ValidateFn

type ValidateFn[CaptureType any] func(value CaptureType) bool

type ValidateFnf

type ValidateFnf[CaptureType any] func(value CaptureType) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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