tests

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const OneMegabyte int64 = 1024 * 1024

Variables

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

Functions

func AssertFilesNoLargerThan

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

func Close

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

func MustTime

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

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

func TempDir

func TempDir(t TestingT) string

func WriteEntry

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

Types

type Async

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

func RunAsync

func RunAsync(f func()) Async

func (*Async) WaitOrFailAfter

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

type Clock

type Clock struct {
	CurrentTime *time.Time
}

func (*Clock) MoveForward

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

func (*Clock) MoveForwardOneHour

func (c *Clock) MoveForwardOneHour()

func (*Clock) Now

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

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