testassert

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testassert checks the conditions of tests, as testify's assert and require do, so tests which use them can be ported without testify

Index

Constants

This section is empty.

Variables

View Source
var (
	// Assert fails a test when a condition is false, and carries on
	Assert = Checker{/* contains filtered or unexported fields */}

	// Require fails a test when a condition is false, and stops it
	Require = Checker{/* contains filtered or unexported fields */}
)

Functions

This section is empty.

Types

type Checker

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

Checker checks a condition of a test, and fails the test when it's false, which stops the test when it's fatal, as testify's require does, and otherwise carries on, as testify's assert does

func (Checker) Contains

func (c Checker) Contains(t *testing.T, container, element any, msgAndArgs ...any) bool

func (Checker) Empty

func (c Checker) Empty(t *testing.T, object any, msgAndArgs ...any) bool

func (Checker) Equal

func (c Checker) Equal(t *testing.T, want, got any, msgAndArgs ...any) bool

func (Checker) ErrorIs

func (c Checker) ErrorIs(t *testing.T, err, target error, msgAndArgs ...any) bool

func (Checker) Len

func (c Checker) Len(t *testing.T, object any, n int, msgAndArgs ...any) bool

func (Checker) Less

func (c Checker) Less(t *testing.T, a, b any, msgAndArgs ...any) bool

func (Checker) NoError

func (c Checker) NoError(t *testing.T, err error, msgAndArgs ...any) bool

func (Checker) NotContains

func (c Checker) NotContains(t *testing.T, container, element any, msgAndArgs ...any) bool

func (Checker) NotEmpty

func (c Checker) NotEmpty(t *testing.T, object any, msgAndArgs ...any) bool

func (Checker) True

func (c Checker) True(t *testing.T, value bool, msgAndArgs ...any) bool

Jump to

Keyboard shortcuts

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