xtesting

package
Version: v0.0.0-...-c9eb28d Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package xtesting provides addons to std package testing.

The tools provided are mostly useful when doing tests with exceptions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asserter

type Asserter struct {
	// contains filtered or unexported fields
}

Asserter is handy objects to make asserts in tests.

For example:

assert := xtesting.Assert(t)
assert.Eq(a, b)
..

Contrary to t.Fatal* and e.g. github.com/stretchr/testify/require.Assert it is safe to use Asserter from non-main goroutine.

func Assert

func Assert(t testing.TB) *Asserter

Assert creates Asserter bound to t for reporting.

func (*Asserter) Eq

func (x *Asserter) Eq(a, b interface{})

Eq asserts that a == b and raises exception if not.

Source Files

Jump to

Keyboard shortcuts

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