testutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2018 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDSN

func CreateDSN(t *testing.T) []string

func CreateDataSources

func CreateDataSources(t *testing.T) ([]string, func())

func Diff

func Diff(expected, actual interface{}) []string

Diff returns a string of differences between expected and actual if any

func LoadData

func LoadData(t *testing.T, ds *db.DataSource, table string, data db.QueryResult)

func LoadDataFromFixture

func LoadDataFromFixture(t *testing.T, ds *db.DataSource, fixture string)

func NewStorage

func NewStorage(t *testing.T, source string) *storage.Storage

func NewStorages

func NewStorages(t *testing.T) (storages []*storage.Storage)

func SetupDataSources

func SetupDataSources(t *testing.T) (db.DataSources, func())

func SetupServer added in v0.3.0

func SetupServer(ds db.DataSources) func()

SetupServer starts a test server and returns its cleanup function

Types

type TestFile

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

TestFile represents a test file

func NewFixture

func NewFixture(t *testing.T, fixture string) *TestFile

NewFixture returns a TestFile from a given fixture

func NewGoldenFile

func NewGoldenFile(t *testing.T, name string) *TestFile

NewGoldenFile returns a TestFile from a given golden name file

func (*TestFile) Load

func (tf *TestFile) Load() string

Load returns the content of a TestFile

func (*TestFile) Parse

func (tf *TestFile) Parse(w io.Writer, data string)

Parse parses the content of a TestFile

func (*TestFile) ParseOrUpdate

func (tf *TestFile) ParseOrUpdate(update bool, data, actual string) string

func (*TestFile) Write

func (tf *TestFile) Write(content string)

Jump to

Keyboard shortcuts

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