tests

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const OneMegabyte int64 = 1024 * 1024

Variables

View Source
var ErrFixed = errors.New("error")

Functions

func AssertFilesNoLargerThan added in v0.2.0

func AssertFilesNoLargerThan(t *testing.T, dir string, fileMaxSize int64)

func Close added in v0.2.0

func Close(t *testing.T, c io.Closer)

func MustTime added in v0.5.0

func MustTime(rfc3339 string) time.Time

func OpenLogReader

func OpenLogReader(t *testing.T, options ...log.OpenReaderOption) log.Reader

func OpenLogWithWriter

func OpenLogWithWriter(t TestingT, options ...log.OpenWriterOption) (*log.Log, *log.Writer)

func OpenLogWriter

func OpenLogWriter(t TestingT, options ...log.OpenWriterOption) *log.Writer

func OpenReader added in v0.6.0

func OpenReader(t TestingT, l *log.Log, options ...log.OpenReaderOption) log.Reader

func TempDir

func TempDir(t TestingT) string

func WriteEntry added in v0.2.0

func WriteEntry(t *testing.T, writer *log.Writer, sizeInBytes int64) time.Time

Types

type Async added in v0.3.0

type Async struct {
	// contains filtered or unexported fields
}

func RunAsync added in v0.3.0

func RunAsync(f func()) Async

func (*Async) WaitOrFailAfter added in v0.3.0

func (a *Async) WaitOrFailAfter(t *testing.T, timeout time.Duration)

type Clock added in v0.3.0

type Clock struct {
	CurrentTime *time.Time
}

func (*Clock) MoveForward added in v0.3.0

func (c *Clock) MoveForward(d time.Duration)

func (*Clock) MoveForwardOneHour added in v0.4.0

func (c *Clock) MoveForwardOneHour()

func (*Clock) Now added in v0.3.0

func (c *Clock) Now() time.Time

type Entry

type Entry struct {
	Time time.Time
	Data []byte
}

func ReadAll

func ReadAll(t *testing.T, l *log.Log, options ...log.OpenReaderOption) []Entry

type TestingT added in v0.5.0

type TestingT interface {
	Errorf(format string, args ...interface{})
	FailNow()
	Helper()
	Cleanup(func())
}

Jump to

Keyboard shortcuts

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