testutils

package
v1.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

type T struct {
	*testing.T
}

T is a wrapper around testing.T which provides additional methods defined in this package. See below for details.

func (*T) Assert

func (t *T) Assert(cond bool)

Assert calls t.Fatal if the condition is false. Also the text of the assertion is printed.

func (*T) AssertDeepEqual

func (t *T) AssertDeepEqual(val, ref interface{})

AssertDeepEqual asserts that the value is equal to some reference.

func (*T) AssertEqual

func (t *T) AssertEqual(val, ref interface{})

AssertEqual asserts that the value is equal to some reference.

func (*T) Check

func (t *T) Check(cond bool)

Check calls t.Error if the condition is false. Also the text of the condition is printed.

func (*T) CheckContains added in v1.10.1

func (t *T) CheckContains(s, substr string)

func (*T) CheckDeepEqual

func (t *T) CheckDeepEqual(val, ref interface{})

CheckDeepEqual checks that the value is equal to some reference.

func (*T) CheckEqual

func (t *T) CheckEqual(val, ref interface{})

CheckEqual checks that the value is equal to some reference.

func (*T) CheckRegexpEqual

func (t *T) CheckRegexpEqual(val, regexs string)

CheckRegexpEqual checks that the value is matched by some regular expression.

func (*T) CheckStringEqual added in v1.4.0

func (t *T) CheckStringEqual(val, ref string)

CheckEqual checks that the string value is equal to some reference.

func (*T) Run

func (t *T) Run(testName string, testFn func(t T))

Run runs the specified sub-test and passes it a T instance from this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL