assertion

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(t reporter, actual []string, expected ...string)

Contains verifies that the actual output contains all expected strings.

func Count

func Count(t reporter, actual []string, expected int)

Count verifies that the output has exactly the expected number of lines.

func Empty

func Empty(t reporter, actual []string)

Empty verifies that the output is empty.

func Equal

func Equal[T comparable](t reporter, actual, expected T, label string)

Equal compares two values and reports if they differ.

func Error

func Error(t reporter, err error)

Error verifies that an error occurred (err != nil).

func ErrorContains

func ErrorContains(t reporter, err error, expected string)

ErrorContains verifies that an error contains the expected substring.

func False

func False(t reporter, condition bool, message string)

False verifies that a condition is false.

func Format

func Format(format string, args ...any) string

Format is a helper for creating formatted error messages.

func Lines

func Lines(t reporter, actual, expected []string)

Lines verifies that actual output matches expected lines. Reports detailed differences using Errorf if they don't match.

func NoError

func NoError(t reporter, err error)

NoError verifies that no error occurred.

func NotContains

func NotContains(t reporter, actual []string, unexpected ...string)

NotContains verifies that the actual output does not contain any of the given strings.

func Prefix

func Prefix(t reporter, actual []string, prefix string)

Prefix verifies that each line starts with the expected prefix.

func Suffix

func Suffix(t reporter, actual []string, suffix string)

Suffix verifies that each line ends with the expected suffix.

func True

func True(t reporter, condition bool, message string)

True verifies that a condition is true.

Types

This section is empty.

Jump to

Keyboard shortcuts

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