test

package
v4.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 License: AGPL-3.0, AGPL-3.0-or-later Imports: 7 Imported by: 0

Documentation

Overview

Package test contains utility functions used throughout the project in tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertBufferEquals

func AssertBufferEquals(t *testing.T, buf, std []byte)

AssertBufferEquals asserts two buffers are equal

func AssertDeepEquals

func AssertDeepEquals(t *testing.T, res, std interface{})

AssertDeepEquals asserts two values are deeply equal or fails the test, if not

func AssertFileEquals

func AssertFileEquals(t *testing.T, path string, std []byte)

AssertFileEquals reads a file from disk and asserts it equals the standard buffer

func GenString

func GenString(len int) string

GenString produces a random base64 string of passed length

func LogUnexpected

func LogUnexpected(t *testing.T, expected, got interface{})

LogUnexpected fails the test and prints the values in an `expected: X got: Y` format

func ReadSample

func ReadSample(t *testing.T, name string) []byte

ReadSample reads a sample file of passed file name

func UnexpectedError

func UnexpectedError(t *testing.T, err error)

UnexpectedError fails the test with an unexpected error message

Types

This section is empty.

Jump to

Keyboard shortcuts

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