Help us shape the future of Go! Take the 2026 Go Developer Survey

mockt

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package mockt implements a system for mocking testing.T.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *t

New creates a new T that does not actually run any tests or exist as part of a test.

Types

type T

type T interface {
	// Failed returns if the test has failed or not, see
	// [testing.T.Failed].
	Failed() bool

	// Fatal is a wrapper around [testing.T.Fatal].
	Fatal(args ...interface{})

	// Cleanup is a wrapper around [testing.T.Cleanup].
	Cleanup(func())
}

T is an interface for testing.T

Jump to

Keyboard shortcuts

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