Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Builtins = NewTestContext(nil)
View Source
var DefaultComparators = NewComparators()
Functions ¶
func IsNotExpectedError ¶
func NewNotExpectedError ¶
func NewNotExpectedError() error
Types ¶
type Comparators ¶
type Comparators struct {
// contains filtered or unexported fields
}
Comparators is a collection of compare functions
func (*Comparators) Get ¶
func (c *Comparators) Get(name string) CompareFunc
Get will return a comparator function by name
type CompareFunc ¶
type CompareFunc func(value interface{}, expected interface{}) error
CompareFunc is the function definition of test comparator without type-system
type NotExpectedError ¶
type NotExpectedError struct {
// contains filtered or unexported fields
}
func (*NotExpectedError) Error ¶
func (e *NotExpectedError) Error() string
type TestComparator ¶
type TestComparator struct {
Comparators *Comparators
}
func NewTestContext ¶
func NewTestContext(m map[string]CompareFunc) TestComparator
func (*TestComparator) NewValidator ¶
func (ctx *TestComparator) NewValidator(valuePath string, expected interface{}, comparator string) driver.TestValidator
NewValidator will return new validator to validate value is expected
Click to show internal directories.
Click to hide internal directories.