testspy

package
v0.0.0-...-a4ecd53 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package testspy implements a lightweight wrapper around testing.TB to assist in the testing of testing frameworks.

N.B. the spy does not the FailNow family of methods, as these would interfere with normal test execution. Instead, they panic if called.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectFail

func ExpectFail(tb testing.TB, f func(t testing.TB))

ExpectFail runs f with a spy TB and expects f to record failures.

func ExpectFatal

func ExpectFatal(tb testing.TB, f func(t testing.TB))

ExpectFatal runs f with a spy TB and expects f to record a fatal failure.

func ExpectPass

func ExpectPass(tb testing.TB, f func(t testing.TB))

ExpectPass runs f with a spy TB and expects f to complete without recording any failures.

func RequireFail

func RequireFail(tb testing.TB, f func(t testing.TB))

RequireFail runs f with a spy TB and requires f to record failures or else fails the test fatally.

func RequireFatal

func RequireFatal(tb testing.TB, f func(t testing.TB))

RequireFatal runs f with a spy TB and requires f to record a fatal failure or else fails the test fatally.

Types

This section is empty.

Jump to

Keyboard shortcuts

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