assert

package
v0.0.0-...-b4a68df Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package assert provides functions for writing assertions in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Between

func Between(tb testing.TB, start, end, actual any, args ...any)

func Diff

func Diff[T any](expected, actual T) []byte

func ElementsMatch

func ElementsMatch[T any](tb testing.TB, expected, actual []T, args ...any) bool

func Equal

func Equal[T any](tb testing.TB, expected, actual T, args ...any)

func Error

func Error(tb testing.TB, expected any, actual error, args ...any) bool

func Fatal

func Fatal(tb testing.TB, msg Message)

func NoError

func NoError(tb testing.TB, actual error, args ...any) bool

func NoPanic

func NoPanic(tb testing.TB, fn func(), args ...any)

func Ok

func Ok[T any](tb testing.TB, v T, err error) T

func Panic

func Panic(tb testing.TB, expected any, fn func(), args ...any)

func Print

func Print(v any)

func Sprint

func Sprint(v any) string

func WithEnviron

func WithEnviron(tb testing.TB, environ map[string]string, fn func())

func WithinDuration

func WithinDuration(tb testing.TB, expected, actual time.Time, delta time.Duration, args ...any)

Types

type Message

type Message struct {
	Header   string
	Expected any
	Actual   any
	Elements []any
	Diff     []byte
}

Directories

Path Synopsis
internal
diff
Package diffp implements a basic diff algorithm equivalent to patience diff.
Package diffp implements a basic diff algorithm equivalent to patience diff.

Jump to

Keyboard shortcuts

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