testutil

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErrors added in v0.8.0

func CheckErrors(expecterrs []ExpectError, errs []error, t *testing.T)

CheckErrors checks actual vs. expected errors.

func CompareSliceInt

func CompareSliceInt(a []int, b []int) bool

CompareSliceInt compares two slices of ints

func CompareSliceString

func CompareSliceString(a []string, b []string) bool

CompareSliceString compares two slices of strings

Types

type ExpectError

type ExpectError struct {
	Filename  string
	EntityID  string
	Field     string
	ErrorType string
}

ExpectError represents a single expected error.

func GetExpectErrors added in v0.8.0

func GetExpectErrors(ent tt.Entity) []ExpectError

GetExpectErrors gets any ExpectError specified by an Entity.

func NewExpectError

func NewExpectError(filename, entityid, field, err string) ExpectError

NewExpectError returns a new ExpectError.

func ParseExpectError

func ParseExpectError(value string) ExpectError

ParseExpectError . e.g.:

InvalidFieldError:agency_name:agency.txt:bad_agency

func ParseExpectErrors added in v1.3.0

func ParseExpectErrors(values ...string) []ExpectError

func (*ExpectError) Equals

func (e *ExpectError) Equals(other ExpectError) bool

Equals checks if two expect errors are equivalent.

func (*ExpectError) Error

func (e *ExpectError) Error() string

func (*ExpectError) Match

func (e *ExpectError) Match(errs []error) bool

Match checks an array of errors and looks for a match.

func (*ExpectError) String

func (e *ExpectError) String() string

type HasContext added in v0.8.0

type HasContext interface {
	Context() *causes.Context
}

Jump to

Keyboard shortcuts

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