assertauto

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package assertauto provides helpers to automatically update the expected values of assertions.

This is highly experimental an not yet ready for public usage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocsPerRun added in v0.4.2

func AllocsPerRun(tb testing.TB, runs int, f func(), optfs ...Option) (float64, bool)

AllocsPerRun asserts that a function allocates a certain number of times per run.

func DeepEqual added in v0.2.4

func DeepEqual[T any](tb testing.TB, v T, optfs ...Option) bool

DeepEqual asserts that the value is deep equal to the expected value.

func Equal

func Equal[T comparable](tb testing.TB, v T, optfs ...Option) bool

Equal asserts that the value is equal to the expected value.

func ErrorEqual added in v0.6.0

func ErrorEqual(tb testing.TB, err error, optfs ...Option) bool

ErrorEqual asserts that the error message is equal to the expected message.

Types

type Option added in v0.4.0

type Option func(*options)

Option is an option for assertauto.

func AssertOptions added in v0.4.0

func AssertOptions(opts ...assert.Option) Option

AssertOptions returns an Option that sets the assert options.

func Name added in v0.4.0

func Name(name string) Option

Name returns an Option that sets the name of the entry.

Jump to

Keyboard shortcuts

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