Documentation ¶
Index ¶
- Constants
- func CreateTestLogger() (*bytes.Buffer, *bytes.Buffer, logging.Logger)
- func GenerateFakeEmail() string
- func GenerateFakePassword() string
- func MustGenerateRandomString(length int, allowLowerAlpha bool, allowUpperAlpha bool, allowNumeric bool) string
- func MustParseLogMessage(msg string) (string, time.Time, string, string)
- func MustParseMailMessage(msg string) (string, string)
- func RequireTimeAlmostEqual(t TestingT, expected time.Time, actual time.Time)
- type MockTestingT
- func (t *MockTestingT) Cleanup(f func())
- func (t *MockTestingT) Error(args ...any)
- func (t *MockTestingT) Errorf(format string, args ...any)
- func (t *MockTestingT) Fail()
- func (t *MockTestingT) FailNow()
- func (t *MockTestingT) Failed() bool
- func (t *MockTestingT) Fatal(args ...any)
- func (t *MockTestingT) Fatalf(format string, args ...any)
- func (t *MockTestingT) Log(args ...any)
- func (t *MockTestingT) Logf(format string, args ...any)
- func (t *MockTestingT) Skip(args ...any)
- func (t *MockTestingT) SkipNow()
- func (t *MockTestingT) Skipf(format string, args ...any)
- func (t *MockTestingT) Skipped() bool
- type TestingT
Constants ¶
const TimeEqualityTolerance = 60 * time.Second
Variables ¶
This section is empty.
Functions ¶
func GenerateFakeEmail ¶
func GenerateFakeEmail() string
GenerateFakeEmail generates a randomized email addresss.
func GenerateFakePassword ¶
func GenerateFakePassword() string
GenerateFakeEmail generates a randomized password.
func MustGenerateRandomString ¶
func MustGenerateRandomString( length int, allowLowerAlpha bool, allowUpperAlpha bool, allowNumeric bool, ) string
MustGenerateRandomString generates a random string and panics on error.
func MustParseMailMessage ¶
Types ¶
type MockTestingT ¶
MockTestingT implements TestingT and is a mock implementation of testing.T.
func NewMockTestingT ¶
func NewMockTestingT() *MockTestingT
NewMockTestingT creates a new MockTestingT.
func (*MockTestingT) Cleanup ¶
func (t *MockTestingT) Cleanup(f func())
Cleanup stores a cleanup function.
func (*MockTestingT) Error ¶
func (t *MockTestingT) Error(args ...any)
Error is equivalent to Log followed by Fail.
func (*MockTestingT) Errorf ¶
func (t *MockTestingT) Errorf(format string, args ...any)
Errorf is equivalent to Logf followed by Fail.
func (*MockTestingT) Failed ¶
func (t *MockTestingT) Failed() bool
Failed reports whether the test has failed.
func (*MockTestingT) Fatal ¶
func (t *MockTestingT) Fatal(args ...any)
Fatal is equivalent to Log followed by FailNow.
func (*MockTestingT) Fatalf ¶
func (t *MockTestingT) Fatalf(format string, args ...any)
Fatalf is equivalent to Logf followed by FailNow.
func (*MockTestingT) Logf ¶
func (t *MockTestingT) Logf(format string, args ...any)
Logf records a formatted log entry.
func (*MockTestingT) Skip ¶
func (t *MockTestingT) Skip(args ...any)
Skip is equivalent to Log followed by SkipNow.
func (*MockTestingT) SkipNow ¶
func (t *MockTestingT) SkipNow()
SkipNow records the test to be skipped.
func (*MockTestingT) Skipf ¶
func (t *MockTestingT) Skipf(format string, args ...any)
Skipf is equivalent to Logf followed by SkipNow.
func (*MockTestingT) Skipped ¶
func (t *MockTestingT) Skipped() bool
Skipped reports whether the test was skipped.
type TestingT ¶
type TestingT interface { Cleanup(f func()) Error(args ...any) Errorf(format string, args ...any) Fail() FailNow() Failed() bool Fatal(args ...any) Fatalf(format string, args ...any) Log(args ...any) Logf(format string, args ...any) Skip(args ...any) SkipNow() Skipf(format string, args ...any) Skipped() bool }
TestingT is an interface wrapper around *testing.T.