test

package
v0.0.0-...-d002785 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(t *testing.T, srcPath, dstPath string)

CopyFile copies a file

func DeepEqual

func DeepEqual(a, b interface{}) bool

DeepEqual is a faster implementation of reflect.DeepEqual that:

  • Has a reflection-free fast-path for all the common types we use.
  • Gives data types the ability to exclude some of their fields from the consideration of DeepEqual by tagging them with `deepequal:"ignore"`.
  • Gives data types the ability to define their own comparison method by implementing the comparable interface.
  • Supports "composite" (or "complex") keys in maps that are pointers.

func Diff

func Diff(expected, actual interface{}) string

Diff returns the difference of two objects in a human readable format. An empty string is returned when there is no difference. To avoid confusing diffs, make sure you pass the expected value first.

func PrettyPrint

func PrettyPrint(v interface{}) string

PrettyPrint tries to display a human readable version of an interface

func PrettyPrintWithDepth

func PrettyPrintWithDepth(v interface{}, depth int) string

PrettyPrintWithDepth tries to display a human readable version of an interface and allows to define the depth of the print

func ShouldPanic

func ShouldPanic(t *testing.T, fn func())

ShouldPanic will test is a function is panicking

func ShouldPanicWith

func ShouldPanicWith(t *testing.T, msg interface{}, fn func())

ShouldPanicWith will test is a function is panicking with a specific message

Types

This section is empty.

Jump to

Keyboard shortcuts

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