Documentation ¶
Index ¶
- Constants
- Variables
- func AssertCompareHelper(t testRunner, object interface{}, option int, msg ...interface{})
- func AssertDirEmptyHelper(t testRunner, dir string) bool
- func AssertRegexpHelper(t testRunner, regex interface{}, txt interface{}, shouldMatch bool, ...)
- func CompareTwoValuesInASlice(a reflect.Value, compareFunc func(a, b reflect.Value) bool) (ret bool)
- func CompletesIn(duration time.Duration, f func()) bool
- func DoesContain(object, element interface{}) bool
- func DoesImplement(interfaceObject, object interface{}) bool
- func Fail(t testRunner, message string, objects Objects, args ...interface{})
- func FailS(message string, objects Objects, args ...interface{}) string
- func GetCurrentScriptDirectory() string
- func GetDifference(a, b interface{}, raw ...bool) string
- func GetTest(t testRunner) *testing.T
- func HasEqualValues(expected interface{}, actual interface{}) bool
- func HasSameElements(expected interface{}, actual interface{}) bool
- func IsEqual(expected interface{}, actual interface{}) bool
- func IsKind(expectedKind reflect.Kind, value interface{}) bool
- func IsList(list interface{}) bool
- func IsNil(object interface{}) bool
- func IsNumber(value interface{}) bool
- func IsSubset(t testRunner, list interface{}, subset interface{}) bool
- func IsZero(value interface{}) bool
- func ModifyWrappedText(text, wrappingString string, modifier func(wrappedText string) string) string
- type Object
- type Objects
Constants ¶
const (
ErrCanNotRunIfNotBuiltinTesting = "This test is only supported on types of *testing.T"
)
Variables ¶
var Highlight = pterm.NewStyle(pterm.FgLightRed).Sprint
var LineNumbersEnabled = true
LineNumbersEnabled controls if line numbers should be printed in the fail printer.
Functions ¶
func AssertCompareHelper ¶ added in v0.2.8
func AssertCompareHelper(t testRunner, object interface{}, option int, msg ...interface{})
AssertCompareHelper option: 1 = increasing, 0 = equal, -1 = decreasing
func AssertDirEmptyHelper ¶ added in v0.2.10
AssertDirEmptyHelper checks for io.EOF to determine if directory empty or not
func AssertRegexpHelper ¶ added in v0.2.8
func AssertRegexpHelper(t testRunner, regex interface{}, txt interface{}, shouldMatch bool, msg ...interface{})
func CompareTwoValuesInASlice ¶ added in v0.2.8
func CompareTwoValuesInASlice(a reflect.Value, compareFunc func(a, b reflect.Value) bool) (ret bool)
CompareTwoValuesInASlice is a helper function.
func CompletesIn ¶ added in v0.2.9
CompletesIn returns if a function completes in a specific time.
func DoesContain ¶ added in v0.2.9
func DoesContain(object, element interface{}) bool
DoesContain checks that ab objects contains an element.
func DoesImplement ¶ added in v0.2.9
func DoesImplement(interfaceObject, object interface{}) bool
DoesImplement checks if an objects implements an interface.
func GetCurrentScriptDirectory ¶ added in v0.2.2
func GetCurrentScriptDirectory() string
GetCurrentScriptDirectory returns the directory of the current Go file.
func GetDifference ¶
GetDifference returns the diff for two projects.
func HasEqualValues ¶ added in v0.2.9
func HasEqualValues(expected interface{}, actual interface{}) bool
HasEqualValues checks if two objects have equal values.
func HasSameElements ¶ added in v0.2.13
func HasSameElements(expected interface{}, actual interface{}) bool
func IsEqual ¶ added in v0.2.9
func IsEqual(expected interface{}, actual interface{}) bool
IsEqual checks if two objects are equal.
func IsNumber ¶ added in v0.2.9
func IsNumber(value interface{}) bool
IsNumber checks if the value is of a numeric kind.
func IsSubset ¶ added in v0.2.14
func IsSubset(t testRunner, list interface{}, subset interface{}) bool
Types ¶
type Objects ¶
type Objects []Object
func NewObjectsExpectedActual ¶
func NewObjectsExpectedActual(expected, actual interface{}) Objects
func NewObjectsSingleNamed ¶
func NewObjectsSingleUnknown ¶
func NewObjectsSingleUnknown(obj interface{}) Objects
func NewObjectsUnknown ¶
func NewObjectsUnknown(objs ...interface{}) Objects