cockroach: github.com/abhinavdahiya/cockroach/testutils Index | Files | Directories

package testutils

import "github.com/abhinavdahiya/cockroach/testutils"

Index

Package Files

base.go error.go keys.go sort.go

func Caller Uses

func Caller(depth ...int) string

Caller returns filename and line number info for the specified stack depths. The info is formated as <file>:<line> and each entry is separated for a space.

func IsError Uses

func IsError(err error, re string) bool

IsError returns true if err is non-nil and the error string matches the supplied regexp.

func IsPError Uses

func IsPError(pErr *roachpb.Error, re string) bool

IsPError returns true if pErr is non-nil and the error message matches the supplied regexp.

func MakeCaller Uses

func MakeCaller(depth ...int) func() string

MakeCaller returns a function which will invoke Caller with the specified arguments.

func MakeKey Uses

func MakeKey(keys ...[]byte) []byte

MakeKey makes a new key which is the concatenation of the given inputs, in order.

func NewNodeTestBaseContext Uses

func NewNodeTestBaseContext() *base.Context

NewNodeTestBaseContext creates a base context for testing. This uses embedded certs and the default node user. The default node user has both server and client certificates.

func NewTestBaseContext Uses

func NewTestBaseContext(user string) *base.Context

NewTestBaseContext creates a secure base context for user.

func SortStructs Uses

func SortStructs(s interface{}, fieldName string)

SortStructs sorts the given slice of structs using the given field as the sort key.

Directories

PathSynopsis
buildutil
gossiputil
localtestcluster
serverutils
sqlutils
storageutils
testcluster

Package testutils imports 10 packages (graph). Updated 2017-03-13. Refresh now. Tools for package owners. This is a dead-end fork (no commits since the fork).