testingutil

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Deprecated: use t.Error and package cmp instead. This package will be deleted.

Package testingutil provides utilities not found in the core testing library.

Unfortunately, because these are functions and not methods of testing, the error coordinates given by these utilities are less clean than they could have been.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectDie

func ExpectDie(t *testing.T, f func(), desc ...interface{})

ExpectDie runs f and tests whether it caused a panic. If not, it calls t.Errorf.

The same formatting convention is used as in ExpectEqual.

func ExpectEqual

func ExpectEqual(t *testing.T, actual, expected interface{}, desc ...interface{})

ExpectEqual tests actual and expected for equality using reflect.DeepEqual and calls t.Errorf with a formatted error if the result is false.

The optional desc parameters are formatted into the failure message if one is needed, and may either be of type string, ...interface{}, in which fmt.Sprintf is used to format them further, or anything else, in which case they are processed with fmt.Sprint.

Types

This section is empty.

Jump to

Keyboard shortcuts

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