Documentation
¶
Index ¶
- Variables
- func BeChronological(actual any, expected ...any) error
- func BeEmpty(actual any, expected ...any) error
- func BeFalse(actual any, expected ...any) error
- func BeGreaterThan(actual any, EXPECTED ...any) error
- func BeGreaterThanOrEqualTo(actual any, expected ...any) error
- func BeIn(actual any, expected ...any) error
- func BeLessThan(actual any, EXPECTED ...any) error
- func BeLessThanOrEqualTo(actual any, expected ...any) error
- func BeNil(actual any, expected ...any) error
- func BeTrue(actual any, expected ...any) error
- func BeZeroValue(actual any, expected ...any) error
- func Contain(actual any, expected ...any) error
- func EndWith(actual any, expected ...any) error
- func Equal(actual any, EXPECTED ...any) error
- func HappenAfter(actual any, expected ...any) error
- func HappenBefore(actual any, expected ...any) error
- func HappenOn(actual any, expected ...any) error
- func HappenWithin(actual any, expected ...any) error
- func HaveLength(actual any, expected ...any) error
- func Panic(actual any, expected ...any) (err error)
- func StartWith(actual any, expected ...any) error
- func WrapError(actual any, expected ...any) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrExpectedCountInvalid = errors.New("expected count invalid") ErrTypeMismatch = errors.New("type mismatch") ErrKindMismatch = errors.New("kind mismatch") ErrAssertionFailure = errors.New("assertion failure") ErrFatalAssertionFailure = errors.New("fatal") )
var NOT negated
NOT (a singleton) constrains all negated assertions to their own namespace.
Functions ¶
func BeChronological ¶
BeChronological asserts whether actual is a []time.Time and whether the values are in chronological order.
func BeGreaterThan ¶
BeGreaterThan verifies that actual is greater than expected. Both actual and expected must be strings or numeric in type.
func BeGreaterThanOrEqualTo ¶
BeGreaterThanOrEqualTo verifies that actual is less than or equal to expected. Both actual and expected must be strings or numeric in type.
func BeLessThan ¶
BeLessThan verifies that actual is less than expected. Both actual and expected must be strings or numeric in type.
func BeLessThanOrEqualTo ¶
BeLessThanOrEqualTo verifies that actual is less than or equal to expected. Both actual and expected must be strings or numeric in type.
func BeZeroValue ¶ added in v2.1.0
BeZeroValue verifies that actual is the zero value for its type.
func Contain ¶
Contain determines whether actual contains expected[0]. The actual value may be a map, array, slice, or string:
- In the case of maps the expected value is assumed to be a map key.
- In the case of slices and arrays the expected value is assumed to be a member.
- In the case of strings the expected value may be a rune or substring.
func EndWith ¶
EndWith verifies that actual ends with expected[0]. The actual value may be an array, slice, or string.
func Equal ¶
Equal verifies that the actual value is equal to the expected value. It uses reflect.DeepEqual in most cases, but also compares numerics regardless of specific type and compares time.Time values using the time.Equal method.
func HappenAfter ¶
HappenAfter ensures that the first time value happens after the second.
func HappenBefore ¶
HappenBefore ensures that the first time value happens before the second.
func HappenOn ¶
HappenOn ensures that two time values happen at the same instant. See the time.Time.Equal method for the details. This function defers to Equal to do the work.
func HappenWithin ¶
HappenWithin ensures that the first time value happens within a specified duration of the other time value. The actual value should be a time.Time. The first expected value should be a time.Duration. The second expected value should be a time.Time.
func HaveLength ¶
HaveLength uses reflection to verify that len(actual) == 0.
func Panic ¶
Panic invokes the func() provided as actual and recovers from any panic. It returns an error if actual() does not result in a panic.
Types ¶
This section is empty.
Source Files
¶
- be_chronological.go
- be_empty.go
- be_false.go
- be_greater_than.go
- be_greater_than_or_equal_to.go
- be_in.go
- be_less_than.go
- be_less_than_or_equal_to.go
- be_nil.go
- be_true.go
- be_zero_value.go
- contain.go
- end_with.go
- equal.go
- errors.go
- expected.go
- happen_after.go
- happen_before.go
- happen_on.go
- happen_within.go
- have_length.go
- kinds.go
- not.go
- panic.go
- spec.go
- start_with.go
- wrap_error.go
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
go-diff/diffmatchpatch
Package diffmatchpatch offers robust algorithms to perform the operations required for synchronizing plain text.
|
Package diffmatchpatch offers robust algorithms to perform the operations required for synchronizing plain text. |