Back to godoc.org

Package xtesting

v0.0.0-...-3cf7f3f
Latest Go to latest

The latest major version is .

Published: May 27, 2020 | License: GPL3 | Module: lab.nexedi.com/kirr/go123

Overview

Package xtesting provides addons to std package testing.

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

Index

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.

Package Files

  • xtesting.go
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier