assert

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: BSD-2-Clause Imports: 7 Imported by: 4

Documentation

Overview

Package assert provides helper functions for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(t *testing.T, got, want interface{}, msg ...string)

Equal asserts that got and want are equal as defined by reflect.DeepEqual. The test fails with msg if they are not equal.

func Matches

func Matches(t *testing.T, value, expr string)

Matches asserts that a value matches a given regular expression.

func Panic

func Panic(t *testing.T, fn func(), matches string)

Panic asserts that function fn() panics. It assumes that recover() either returns a string or an error and fails if the message does not match the regular expression in 'matches'.

Types

This section is empty.

Jump to

Keyboard shortcuts

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