Documentation ¶
Index ¶
- Constants
- func Assert(t *testing.T, actual interface{}, matcher Matcher)
- type BaseMatcher
- type Matcher
- func ContainString(expected string) Matcher
- func EmptyList() Matcher
- func EndWith(expected string) Matcher
- func Equal(expected interface{}) Matcher
- func GreaterThan(expected interface{}) Matcher
- func GreaterThanOrEquals(expected interface{}) Matcher
- func HasItems(expected interface{}) Matcher
- func HasMapValue(expected interface{}) Matcher
- func LessThan(expected interface{}) Matcher
- func LessThanOrEquals(expected interface{}) Matcher
- func NilVal() Matcher
- func Not(matcher Matcher) Matcher
- func NotEqual(expected interface{}) Matcher
- func NotNilVal() Matcher
- func StartWith(expected string) Matcher
Constants ¶
View Source
const ( EMPTY = "" LOGIC_NOT = " not " )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseMatcher ¶
type BaseMatcher struct { Expected interface{} Reason string }
func (*BaseMatcher) FailReason ¶
func (this *BaseMatcher) FailReason(actual interface{}) string
func (*BaseMatcher) Match ¶
func (this *BaseMatcher) Match(actual interface{}) bool
func (*BaseMatcher) NegationFailReason ¶
func (this *BaseMatcher) NegationFailReason(actual interface{}) string
type Matcher ¶
type Matcher interface { //run match Match(actual interface{}) bool //get fail reason FailReason(actual interface{}) string //get negation fail reason NegationFailReason(actual interface{}) string }
func ContainString ¶
func Equal ¶
func Equal(expected interface{}) Matcher
Create a Matcher for match the actual object is equal excepted object example:
func GreaterThan ¶
func GreaterThan(expected interface{}) Matcher
func GreaterThanOrEquals ¶
func GreaterThanOrEquals(expected interface{}) Matcher
func HasMapValue ¶ added in v1.1.0
func HasMapValue(expected interface{}) Matcher
func LessThanOrEquals ¶
func LessThanOrEquals(expected interface{}) Matcher
Click to show internal directories.
Click to hide internal directories.