gtc

package module
v0.0.0-...-a9a8a11 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2014 License: LGPL-3.0 Imports: 6 Imported by: 0

README

go-test-common

Some common testing infrastructure that I'm tired of reimplementing.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertError

func AssertError(t *testing.T, err error, text string, fail bool)

A shorthand where, if text == "", we assert that there was no error... and otherwise, we assert that an error occurred, and verify that err.Error() == text.

The `fail` bool determines whether an unexpected result should call t.FailNow(), rather than just t.Error().

Types

type TempDirTracker

type TempDirTracker struct {
	Dirs   []string
	Tester *testing.T
}

func NewTempDirTracker

func NewTempDirTracker(t *testing.T) TempDirTracker

func (*TempDirTracker) Cleanup

func (tracker *TempDirTracker) Cleanup()

func (*TempDirTracker) Create

func (tracker *TempDirTracker) Create() string

type WriteCompare

type WriteCompare struct {
	*bytes.Buffer
	Replacements map[string]string
}

Useful for comparing logs to expected results.

func NewWriteCompare

func NewWriteCompare() WriteCompare

func (*WriteCompare) String

func (wc *WriteCompare) String() string

Jump to

Keyboard shortcuts

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