Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Assertion ¶
type Assertion interface {
EvaluateFor(x interface{}) *Result
}
Assertion represents a single assertable fact. Assertions are provided as the last parameter to the test.That function. The type *is.Equal is an example of an Assertion.
type MockT ¶
type MockT struct {
// contains filtered or unexported fields
}
MockT is an implementation of TLike that is used to unit test the assertions in this package. It likely has few uses outside of this package.
func (*MockT) DidFailWith ¶
DidFailWith returns true if Fatalf was called and the regex pattern provided matches the failure message.
func (*MockT) Fatalf ¶
Fatalf simply formats the provided format and args and then stores the result to later be verified. It can be searched for within the MockT using the DidFailWith method.
func (*MockT) GetFailureMessage ¶
GetFailureMessage returns the failure message, or any empty string if Fatalf has not been called.
type Result ¶
Result represents the result of evaluating an Assertion. It provides information used for error reporting.
func (*Result) AssertPassed ¶
AssertPassed will fail the provided TLike with a user-friendly message if the result indicates failure.