jtest

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package jtest provides simple test assertion functions for the jettison errors package.

The style is similar to the assert and require packages of the github.com/stretchr/testify library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(t testing.TB, expected, actual error, msgs ...interface{}) bool

Assert asserts that the specified error matches the expected one. The test will be marked failed if it does not.

jtest.Assert(t, ErrWhatIExpect, err)

func AssertNil

func AssertNil(t testing.TB, actual error, msgs ...interface{}) bool

AssertNil asserts that the specified error is nil. The test will be marked failed if it does not. It is shorthand for `jtest.Assert(t, nil, err)`, although it provides slightly clearer failure output.

jtest.AssertNil(t, err)

func Require

func Require(t testing.TB, expected, actual error, msg ...interface{})

Require asserts that the specified error matches the expected one. The test will be marked failed if it does not. It also stops test execution when it fails.

jtest.Require(t, ErrWhatIExpect, err)

func RequireNil

func RequireNil(t testing.TB, actual error, msg ...interface{})

RequireNil asserts that the specified error is nil. The test will be marked failed if it does not, and execution will be stopped. It is shorthand for `jtest.Require(t, nil, err)`, although it provides slightly clearer failure output.

jtest.RequireNil(t, err)

Types

This section is empty.

Jump to

Keyboard shortcuts

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