go123: lab.nexedi.com/kirr/go123/internal/xtesting Index | Files

package xtesting

import "lab.nexedi.com/kirr/go123/internal/xtesting"

Package xtesting provides addons to std package testing.

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

Index

Package Files

xtesting.go

type Asserter Uses

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 Uses

func Assert(t testing.TB) *Asserter

Assert creates Asserter bound to t for reporting.

func (*Asserter) Eq Uses

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

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

Package xtesting imports 4 packages (graph) and is imported by 1 packages. Updated 2019-08-12. Refresh now. Tools for package owners.