errverify

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMatch

func IsMatch(
	params *VerifyParams,
	isVerifyErrorMsg bool,
	verifier *Verifier,
) bool

func IsMatchCollection

func IsMatchCollection(
	params *VerifyCollectionParams,
	verifier *CollectionVerifier,
) bool

Types

type CollectionVerifier

type CollectionVerifier struct {
	Verifier
	ExpectationLines *corestr.SimpleSlice
	ErrorLength      int // -1 represents no checking or length
}

CollectionVerifier helps to compare lines in error collection

func (CollectionVerifier) ExpectedValidateErrUsingTextValidator added in v0.7.1

func (it CollectionVerifier) ExpectedValidateErrUsingTextValidator(
	params *corevalidator.ValidatorParamsBase,
	isUseStrings bool,
	errorCollectionActual *errwrappers.Collection,
	expected string,
) *errorwrapper.Wrapper

func (CollectionVerifier) ExpectingLinesValidateErrUsingSliceValidator added in v0.7.1

func (it CollectionVerifier) ExpectingLinesValidateErrUsingSliceValidator(
	params *corevalidator.ValidatorParamsBase,
	errorCollectionActual *errwrappers.Collection,
	expectedLines []string,
) *errorwrapper.Wrapper

func (*CollectionVerifier) IsMatch

func (it *CollectionVerifier) IsMatch(
	params *VerifyCollectionParams,
) bool

func (*CollectionVerifier) IsMatchTestCase added in v0.7.4

func (it *CollectionVerifier) IsMatchTestCase(
	caseIndex int,
	errCollection *errwrappers.Collection,
) bool

func (CollectionVerifier) ValidateErrUsingSliceValidator added in v0.7.1

func (it CollectionVerifier) ValidateErrUsingSliceValidator(
	params *corevalidator.ValidatorParamsBase,
	errorCollectionActual *errwrappers.Collection,
) *errorwrapper.Wrapper

func (CollectionVerifier) ValidateErrUsingTextValidator added in v0.7.1

func (it CollectionVerifier) ValidateErrUsingTextValidator(
	params *corevalidator.ValidatorParamsBase,
	isUseStrings bool,
	errorCollectionActual *errwrappers.Collection,
) *errorwrapper.Wrapper

type Verifier

type Verifier struct {
	Header, FunctionName string
	ExpectingMessage     string // It has no use in CollectionVerifier
	corevalidator.ValidatorCoreCondition
	VerifyAs                 stringcompareas.Variant
	IsCompareEmpty           bool // true means, seek for empty only
	IsVerifyErrorMessageOnly bool // don't verify full message
	IsPrintError             bool
}

func (*Verifier) HasExpectingMessage added in v0.7.1

func (it *Verifier) HasExpectingMessage() bool

func (*Verifier) IsEmptyExpectingMessage added in v0.7.1

func (it *Verifier) IsEmptyExpectingMessage() bool

func (*Verifier) IsMatch

func (it *Verifier) IsMatch(
	params *VerifyParams,
) bool

func (*Verifier) MethodName added in v0.7.1

func (it *Verifier) MethodName() string

func (Verifier) NewSliceValidator added in v0.7.1

func (it Verifier) NewSliceValidator(
	inputLines, comparingLines []string,
) *corevalidator.SliceValidator

func (Verifier) NewTextValidator added in v0.7.1

func (it Verifier) NewTextValidator(
	searchTerm string,
) *corevalidator.TextValidator

func (Verifier) ValidateActualLinesSliceValidator added in v0.7.1

func (it Verifier) ValidateActualLinesSliceValidator(
	params *corevalidator.ValidatorParamsBase,
	actualLines []string,
	expectedLines []string,
) *errorwrapper.Wrapper

func (Verifier) ValidateErrCollectionUsingSliceValidator added in v0.7.1

func (it Verifier) ValidateErrCollectionUsingSliceValidator(
	isIncludeReferences bool,
	params *corevalidator.ValidatorParamsBase,
	errCollection *errwrappers.Collection,
	expectedLines []string,
) *errorwrapper.Wrapper

func (Verifier) ValidateErrUsingSliceValidator added in v0.7.1

func (it Verifier) ValidateErrUsingSliceValidator(
	params *corevalidator.ValidatorParamsBase,
	errorWrapper *errorwrapper.Wrapper,
	expectedLines []string,
) *errorwrapper.Wrapper

func (Verifier) ValidateErrUsingTextValidator added in v0.7.1

func (it Verifier) ValidateErrUsingTextValidator(
	isCompareIncludingReference bool,
	params *corevalidator.ValidatorParamsBase,
	actualErrorWrapper *errorwrapper.Wrapper,
) *errorwrapper.Wrapper

type VerifyCollectionParams added in v0.7.1

type VerifyCollectionParams struct {
	CaseIndex                 int
	FuncName                  string
	TestCaseName              string
	IsCompareWithoutReference bool
	ErrorCollection           *errwrappers.Collection
}

func (VerifyCollectionParams) IsWithRef added in v0.9.2

func (it VerifyCollectionParams) IsWithRef() bool

type VerifyParams added in v0.7.1

type VerifyParams struct {
	CaseIndex                 int
	FuncName                  string
	TestCaseName              string
	IsCompareWithoutReference bool
	ErrorWrapper              *errorwrapper.Wrapper
}

func (VerifyParams) IsWithRef added in v0.9.2

func (it VerifyParams) IsWithRef() bool

Jump to

Keyboard shortcuts

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