Documentation ¶
Overview ¶
Package testutil contains common utilities to test Kythe libraries.
Index ¶
- func DeepEqual(expected, got interface{}) error
- func Errorf(t *testing.T, msg string, err error, args ...interface{})
- func FatalOnErr(b *testing.B, msg string, err error, args ...interface{})
- func FatalOnErrT(t *testing.T, msg string, err error, args ...interface{})
- func JSONEqual(expected, got []byte) error
- func RandBytes(bytes []byte)
- func RandStr(size int) string
- func TestFilePath(t *testing.T, path string) string
- func TrimmedEqual(got, want []byte) (bool, string)
- func YAMLEqual(expected, got []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepEqual ¶ added in v0.0.9
func DeepEqual(expected, got interface{}) error
DeepEqual determines if expected is deeply equal to got, returning a detailed error if not. It is okay for expected and got to be protobuf message values.
func FatalOnErr ¶
FatalOnErr calls b.Fatalf(msg, err, args...) if err != nil
func FatalOnErrT ¶
FatalOnErrT calls t.Fatalf(msg, err, args...) if err != nil
func JSONEqual ¶ added in v0.0.30
JSONEqual compares two bytes assuming they are json, using encoding/json and DeepEqual.
func TestFilePath ¶ added in v0.0.29
TestFilePath takes a path and resolves it based on the testdir. If it cannot successfully do so, it calls t.Fatal and abandons.
func TrimmedEqual ¶ added in v0.0.29
TrimmedEqual compares two strings after collapsing irrelevant whitespace at the beginning or end of lines. It returns both a boolean indicating equality, as well as any relevant diff.
Types ¶
This section is empty.