Documentation
¶
Overview ¶
package testutil is internal test helpers package
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsOnlySubTest ¶
IsOnlySubTest returns name of single subtest that should be run
Types ¶
type ExpectedError ¶
type ExpectedError string
ExpectedError is string which should be in expected error
func (ExpectedError) AssertError ¶
func (x ExpectedError) AssertError(t *testing.T, err error) bool
AssertError checks if error contains expected string.
Returns true if no errors expected or got and test can be continued.
Example:
if !wantErr.AssertError(t, err) { // Some error in test expected, so just exit return } assert.Equal(t, want, got)
func (ExpectedError) Empty ¶
func (x ExpectedError) Empty() bool
Empty returns if expected string is empty
type FixtureFromString ¶
type FixtureFromString string
FixtureFromString indicates that source is plain string
func (FixtureFromString) ProvideFixture ¶
func (j FixtureFromString) ProvideFixture(t *testing.T) []byte
ProvideFixture implements FixtureProvider
type FixtureProvider ¶
FixtureProvider is test fixture provider
type TestdataFixture ¶
type TestdataFixture string
TestdataFixture indicates that source should be taken from file in testdata dir
func (TestdataFixture) ProvideFixture ¶
func (j TestdataFixture) ProvideFixture(t *testing.T) []byte
ProvideFixture implements FixtureProvider
Click to show internal directories.
Click to hide internal directories.