Back to

Package xtesting

Latest Go to latest

The latest major version is .

Published: May 27, 2020 | License: GPL3 | Module:


Package xtesting provides addons to std package testing.

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


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. 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