matcher

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeEmptyMatcher

type BeEmptyMatcher struct{}

func (BeEmptyMatcher) MatcherName

func (BeEmptyMatcher) MatcherName() string

func (BeEmptyMatcher) Type

func (BeEmptyMatcher) Type() Type

type BeEquivalentToMatcher

type BeEquivalentToMatcher struct {
	value.Value
}

func (BeEquivalentToMatcher) MatcherName

func (BeEquivalentToMatcher) MatcherName() string

func (BeEquivalentToMatcher) Type

func (BeEquivalentToMatcher) Type() Type

type BeFalseMatcher

type BeFalseMatcher struct{}

func (BeFalseMatcher) MatcherName

func (BeFalseMatcher) MatcherName() string

func (BeFalseMatcher) Type

func (BeFalseMatcher) Type() Type

type BeIdenticalToMatcher

type BeIdenticalToMatcher struct {
	value.Value
}

func (BeIdenticalToMatcher) MatcherName

func (BeIdenticalToMatcher) MatcherName() string

func (BeIdenticalToMatcher) Type

func (BeIdenticalToMatcher) Type() Type

type BeNilMatcher

type BeNilMatcher struct{}

func (BeNilMatcher) MatcherName

func (BeNilMatcher) MatcherName() string

func (BeNilMatcher) Type

func (BeNilMatcher) Type() Type

type BeNumericallyMatcher

type BeNumericallyMatcher struct {
	// contains filtered or unexported fields
}

func (BeNumericallyMatcher) GetOp

func (m BeNumericallyMatcher) GetOp() token.Token

func (BeNumericallyMatcher) GetType

func (m BeNumericallyMatcher) GetType() gotypes.Type

func (BeNumericallyMatcher) GetValue

func (m BeNumericallyMatcher) GetValue() constant.Value

func (BeNumericallyMatcher) GetValueExpr

func (m BeNumericallyMatcher) GetValueExpr() ast.Expr

func (BeNumericallyMatcher) IsError

func (m BeNumericallyMatcher) IsError() bool

func (BeNumericallyMatcher) IsFunc

func (m BeNumericallyMatcher) IsFunc() bool

func (BeNumericallyMatcher) IsInterface

func (m BeNumericallyMatcher) IsInterface() bool

func (BeNumericallyMatcher) IsPointer

func (m BeNumericallyMatcher) IsPointer() bool

func (BeNumericallyMatcher) IsValueInt

func (m BeNumericallyMatcher) IsValueInt() bool

func (BeNumericallyMatcher) IsValueNumeric

func (m BeNumericallyMatcher) IsValueNumeric() bool

func (BeNumericallyMatcher) IsValueZero

func (m BeNumericallyMatcher) IsValueZero() bool

func (BeNumericallyMatcher) MatcherName

func (BeNumericallyMatcher) MatcherName() string

func (BeNumericallyMatcher) Type

func (m BeNumericallyMatcher) Type() Type

type BeTrueMatcher

type BeTrueMatcher struct{}

func (BeTrueMatcher) MatcherName

func (BeTrueMatcher) MatcherName() string

func (BeTrueMatcher) Type

func (BeTrueMatcher) Type() Type

type BeZeroMatcher

type BeZeroMatcher struct{}

func (BeZeroMatcher) MatcherName

func (BeZeroMatcher) MatcherName() string

func (BeZeroMatcher) Type

func (BeZeroMatcher) Type() Type

type EqualFalseMatcher

type EqualFalseMatcher struct{}

func (EqualFalseMatcher) MatcherName

func (EqualFalseMatcher) MatcherName() string

func (EqualFalseMatcher) Type

func (EqualFalseMatcher) Type() Type

type EqualMatcher

type EqualMatcher struct {
	// contains filtered or unexported fields
}

func (EqualMatcher) GetType

func (m EqualMatcher) GetType() gotypes.Type

func (EqualMatcher) GetValue

func (m EqualMatcher) GetValue() constant.Value

func (EqualMatcher) GetValueExpr

func (m EqualMatcher) GetValueExpr() ast.Expr

func (EqualMatcher) IsError

func (m EqualMatcher) IsError() bool

func (EqualMatcher) IsFunc

func (m EqualMatcher) IsFunc() bool

func (EqualMatcher) IsInterface

func (m EqualMatcher) IsInterface() bool

func (EqualMatcher) IsPointer

func (m EqualMatcher) IsPointer() bool

func (EqualMatcher) IsValueInt

func (m EqualMatcher) IsValueInt() bool

func (EqualMatcher) IsValueNumeric

func (m EqualMatcher) IsValueNumeric() bool

func (EqualMatcher) IsValueZero

func (m EqualMatcher) IsValueZero() bool

func (EqualMatcher) MatcherName

func (EqualMatcher) MatcherName() string

func (EqualMatcher) Type

func (EqualMatcher) Type() Type

type EqualNilMatcher

type EqualNilMatcher struct {
	// contains filtered or unexported fields
}

func (EqualNilMatcher) GetType

func (n EqualNilMatcher) GetType() gotypes.Type

func (EqualNilMatcher) MatcherName

func (EqualNilMatcher) MatcherName() string

func (EqualNilMatcher) Type

func (EqualNilMatcher) Type() Type

type EqualTrueMatcher

type EqualTrueMatcher struct{}

func (EqualTrueMatcher) MatcherName

func (EqualTrueMatcher) MatcherName() string

func (EqualTrueMatcher) Type

func (EqualTrueMatcher) Type() Type

type HaveLenZeroMatcher

type HaveLenZeroMatcher struct{}

func (HaveLenZeroMatcher) MatcherName

func (HaveLenZeroMatcher) MatcherName() string

func (HaveLenZeroMatcher) Type

func (HaveLenZeroMatcher) Type() Type

type HaveOccurredMatcher added in v0.18.0

type HaveOccurredMatcher struct{}

func (*HaveOccurredMatcher) MatcherName added in v0.18.0

func (m *HaveOccurredMatcher) MatcherName() string

func (*HaveOccurredMatcher) Type added in v0.18.0

func (m *HaveOccurredMatcher) Type() Type

type HaveValueMatcher

type HaveValueMatcher struct {
	// contains filtered or unexported fields
}

func (*HaveValueMatcher) GetNested

func (m *HaveValueMatcher) GetNested() *Matcher

func (*HaveValueMatcher) MatcherName

func (m *HaveValueMatcher) MatcherName() string

func (*HaveValueMatcher) Type

func (m *HaveValueMatcher) Type() Type

type Info

type Info interface {
	Type() Type
	MatcherName() string
}

type InvalidMatchErrorMatcher

type InvalidMatchErrorMatcher struct {
	// contains filtered or unexported fields
}

func (*InvalidMatchErrorMatcher) AllowedNumArgs

func (m *InvalidMatchErrorMatcher) AllowedNumArgs() int

func (*InvalidMatchErrorMatcher) GetValueExpr

func (m *InvalidMatchErrorMatcher) GetValueExpr() ast.Expr

func (*InvalidMatchErrorMatcher) MatcherName

func (m *InvalidMatchErrorMatcher) MatcherName() string

func (*InvalidMatchErrorMatcher) NumArgs

func (m *InvalidMatchErrorMatcher) NumArgs() int

func (*InvalidMatchErrorMatcher) Type

func (m *InvalidMatchErrorMatcher) Type() Type

type MatchErrorMatcher

type MatchErrorMatcher interface {
	Info
	AllowedNumArgs() int
	NumArgs() int
}

type MatchErrorMatcherWithErr

type MatchErrorMatcherWithErr struct {
	// contains filtered or unexported fields
}

func (*MatchErrorMatcherWithErr) AllowedNumArgs

func (m *MatchErrorMatcherWithErr) AllowedNumArgs() int

func (*MatchErrorMatcherWithErr) MatcherName

func (m *MatchErrorMatcherWithErr) MatcherName() string

func (*MatchErrorMatcherWithErr) NumArgs

func (m *MatchErrorMatcherWithErr) NumArgs() int

func (*MatchErrorMatcherWithErr) Type

func (m *MatchErrorMatcherWithErr) Type() Type

type MatchErrorMatcherWithErrFunc

type MatchErrorMatcherWithErrFunc struct {
	// contains filtered or unexported fields
}

func (*MatchErrorMatcherWithErrFunc) AllowedNumArgs

func (m *MatchErrorMatcherWithErrFunc) AllowedNumArgs() int

func (*MatchErrorMatcherWithErrFunc) IsSecondArgString

func (m *MatchErrorMatcherWithErrFunc) IsSecondArgString() bool

func (*MatchErrorMatcherWithErrFunc) MatcherName

func (m *MatchErrorMatcherWithErrFunc) MatcherName() string

func (*MatchErrorMatcherWithErrFunc) NumArgs

func (m *MatchErrorMatcherWithErrFunc) NumArgs() int

func (*MatchErrorMatcherWithErrFunc) Type

type MatchErrorMatcherWithMatcher

type MatchErrorMatcherWithMatcher struct {
	// contains filtered or unexported fields
}

func (*MatchErrorMatcherWithMatcher) AllowedNumArgs

func (m *MatchErrorMatcherWithMatcher) AllowedNumArgs() int

func (*MatchErrorMatcherWithMatcher) MatcherName

func (m *MatchErrorMatcherWithMatcher) MatcherName() string

func (*MatchErrorMatcherWithMatcher) NumArgs

func (m *MatchErrorMatcherWithMatcher) NumArgs() int

func (*MatchErrorMatcherWithMatcher) Type

type MatchErrorMatcherWithString

type MatchErrorMatcherWithString struct {
	// contains filtered or unexported fields
}

func (*MatchErrorMatcherWithString) AllowedNumArgs

func (m *MatchErrorMatcherWithString) AllowedNumArgs() int

func (*MatchErrorMatcherWithString) MatcherName

func (m *MatchErrorMatcherWithString) MatcherName() string

func (*MatchErrorMatcherWithString) NumArgs

func (m *MatchErrorMatcherWithString) NumArgs() int

func (*MatchErrorMatcherWithString) Type

type Matcher

type Matcher struct {
	Orig  *ast.CallExpr
	Clone *ast.CallExpr
	// contains filtered or unexported fields
}

func New

func New(origMatcher, matcherClone *ast.CallExpr, pass *analysis.Pass, handler gomegahandler.Handler) (*Matcher, bool)

func (*Matcher) GetMatcherInfo

func (m *Matcher) GetMatcherInfo() Info

func (*Matcher) ReplaceMatcherArgs

func (m *Matcher) ReplaceMatcherArgs(newArgs []ast.Expr)

func (*Matcher) ReplaceMatcherFuncName

func (m *Matcher) ReplaceMatcherFuncName(name string)

func (*Matcher) ShouldReverseLogic

func (m *Matcher) ShouldReverseLogic() bool

type MultipleMatchersMatcher

type MultipleMatchersMatcher struct {
	// contains filtered or unexported fields
}

func (*MultipleMatchersMatcher) At

func (*MultipleMatchersMatcher) Len

func (m *MultipleMatchersMatcher) Len() int

func (*MultipleMatchersMatcher) MatcherName

func (m *MultipleMatchersMatcher) MatcherName() string

func (*MultipleMatchersMatcher) Type

func (m *MultipleMatchersMatcher) Type() Type

type SucceedMatcher added in v0.18.0

type SucceedMatcher struct{}

func (*SucceedMatcher) MatcherName added in v0.18.0

func (m *SucceedMatcher) MatcherName() string

func (*SucceedMatcher) Type added in v0.18.0

func (m *SucceedMatcher) Type() Type

type Type

type Type uint64
const (
	Unspecified Type = 1 << iota
	EqualMatcherType
	BeZeroMatcherType
	BeEmptyMatcherType
	BeTrueMatcherType
	BeFalseMatcherType
	BeNumericallyMatcherType
	HaveLenZeroMatcherType
	BeEquivalentToMatcherType
	BeIdenticalToMatcherType
	BeNilMatcherType
	MatchErrorMatcherType
	MultipleMatcherMatherType
	HaveValueMatherType
	WithTransformMatherType
	EqualBoolValueMatcherType
	EqualValueMatcherType
	HaveOccurredMatcherType
	SucceedMatcherType
	EqualNilMatcherType

	BoolValueFalse
	BoolValueTrue

	OrMatherType
	AndMatherType

	ErrMatchWithErr
	ErrMatchWithErrFunc
	ErrMatchWithString
	ErrMatchWithMatcher

	EqualZero
	GreaterThanZero
)

func (Type) Is

func (t Type) Is(other Type) bool

type UnspecifiedMatcher

type UnspecifiedMatcher struct {
	// contains filtered or unexported fields
}

func (UnspecifiedMatcher) MatcherName

func (u UnspecifiedMatcher) MatcherName() string

func (UnspecifiedMatcher) Type

func (UnspecifiedMatcher) Type() Type

type WithTransformMatcher

type WithTransformMatcher struct {
	// contains filtered or unexported fields
}

func (*WithTransformMatcher) GetFuncType

func (m *WithTransformMatcher) GetFuncType() gotypes.Type

func (*WithTransformMatcher) GetNested

func (m *WithTransformMatcher) GetNested() *Matcher

func (*WithTransformMatcher) MatcherName

func (m *WithTransformMatcher) MatcherName() string

func (*WithTransformMatcher) Type

func (m *WithTransformMatcher) Type() Type

Jump to

Keyboard shortcuts

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