Documentation ¶
Overview ¶
Package assert provides some convinient asserting functions on strings, lines, and string sets for testings.
Return values: true if the assert holds, false otherwise.
Index ¶
- func Equals(t *testing.T, name string, act, exp interface{}) bool
- func IsFalse(t *testing.T, name string, exp bool) bool
- func IsTrue(t *testing.T, name string, exp bool) bool
- func LinesEqual(t *testing.T, name string, act, exp []string) bool
- func Maps(t *testing.T, name string, src []interface{}, dst []interface{}, ...) bool
- func NoError(t *testing.T, err error) bool
- func NoErrorf(t *testing.T, fmtStr string, err error) bool
- func NotEquals(t *testing.T, name string, act, exp interface{}) bool
- func StrSetEquals(t *testing.T, name string, act, exp villa.StrSet) bool
- func StringEquals(t *testing.T, name string, act, exp interface{}) bool
- func TextEquals(t *testing.T, name string, act, exp string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LinesEqual ¶
LinesEqual fails the test and shows the error message and line-to-line differences of the lines when two slices of strings are not equal
func Maps ¶
func Maps(t *testing.T, name string, src []interface{}, dst []interface{}, f func(src interface{}) interface{}) bool
Maps asserts whether a mapping function works as expected.
func NoErrorf ¶
NoErrorf is similar to NoError with an extra format string. The first and only variable in the format string should be %v for error.
func StrSetEquals ¶
StrSetEquals fails the test and shows error message when act and exp are not equal string sets.
func StringEquals ¶
StringEquals fails the test and shows error message when string forms of act and exp are not equal
Types ¶
This section is empty.