Documentation ¶
Index ¶
- Constants
- Variables
- func AssertCompareHelper(t testRunner, object any, option int, msg ...any)
- func AssertDirEmptyHelper(t testRunner, dir string) bool
- func AssertRegexpHelper(t testRunner, regex any, txt any, shouldMatch bool, msg ...any)
- 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 any) bool
- func DoesImplement(interfaceObject, object any) bool
- func Fail(t testRunner, message string, objects Objects, args ...any)
- func FailS(message string, objects Objects, args ...any) string
- func GetCurrentScriptDirectory() string
- func GetDifference(a, b any, raw ...bool) string
- func GetTest(t testRunner) *testing.T
- func HasEqualValues(expected any, actual any) bool
- func HasSameElements(expected any, actual any) bool
- func IsEqual(expected any, actual any) bool
- func IsKind(expectedKind reflect.Kind, value any) bool
- func IsList(list any) bool
- func IsNil(object any) bool
- func IsNumber(value any) bool
- func IsSubset(t testRunner, list any, subset any) bool
- func IsZero(value any) bool
- func ModifyWrappedText(text, wrappingString string, modifier func(wrappedText string) string) string
- type Object
- type Objects
Constants ¶
View Source
const (
ErrCanNotRunIfNotBuiltinTesting = "This test is only supported on types of *testing.T"
)
Variables ¶
View Source
var DiffContextLines = 2
View Source
var Highlight = pterm.NewStyle(pterm.FgLightRed).Sprint
View Source
var LineNumbersEnabled = true
LineNumbersEnabled controls if line numbers should be printed in the fail printer.
Functions ¶
func AssertCompareHelper ¶ added in v0.2.8
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 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
DoesContain checks that ab objects contains an element.
func DoesImplement ¶ added in v0.2.9
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
HasEqualValues checks if two objects have equal values.
func HasSameElements ¶ added in v0.2.13
Types ¶
type Object ¶
func NewDiffObject ¶ added in v0.3.2
type Objects ¶
type Objects []Object
func NewObjectsExpectedActualWithDiff ¶ added in v0.3.2
func NewObjectsSingleNamed ¶
func NewObjectsSingleUnknown ¶
func NewObjectsUnknown ¶
Click to show internal directories.
Click to hide internal directories.