assert

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func So added in v0.12.0

func So(actual interface{}, assertion Assertion, expected ...interface{}) error

So runs the provided Assertion and returns the error, as in: err := assert.So(1, should.Equal, 1)

Types

type Assertion

type Assertion func(actual interface{}, expected ...interface{}) error

type TestingT added in v0.12.0

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

TestingT is an intermediate type, not for direct instantiation.

func Error added in v0.12.0

func Error(t testingT) TestingT

Error receives a *testing.T, and prepares the caller for a So call. In the event of an assertion failure it will pass the err to *testing.T.Error. assert.Error(t).So(1, should.Equal, 2) // results in t.Error(err)

func Fatal added in v0.12.0

func Fatal(t testingT) TestingT

Fatal receives a *testing.T, and prepares the caller for a So call. In the event of an assertion failure it will pass the err to *testing.T.Fatal. assert.Fatal(t).So(1, should.Equal, 2) // results in t.Fatal(err)

func Log added in v0.12.0

func Log(t testingT) TestingT

Log receives a *testing.T, and prepares the caller for a So call. In the event of an assertion failure it will pass the err to *testing.T.Log. assert.Log(t).So(1, should.Equal, 2) // results in t.Log(err)

func (TestingT) So added in v0.12.0

func (this TestingT) So(actual interface{}, assertion Assertion, expected ...interface{})

So runs the provided Assertion and calls the configured reporting function, as in: - assert.Log(t).So(1, should.Equal, 1) - assert.Error(t).So(1, should.Equal, 1) - assert.Fatal(t).So(1, should.Equal, 1)

Jump to

Keyboard shortcuts

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