ct

package
v0.0.0-...-8587fb3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Overview

package ct contains wrappers and interfaces around testing.T

The intention is that _all_ complement functions deal with these wrapper interfaces rather than the literal testing.T. This enables Complement to be run in environments that aren't strictly via `go test`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(t TestLike, format string, args ...any)

Errorf is a wrapper around t.Errorf which prints the failing error message in red.

func Fatalf

func Fatalf(t TestLike, format string, args ...any)

Fatalf is a wrapper around t.Fatalf which prints the failing error message in red.

Types

type TestLike

type TestLike interface {
	Helper()
	Logf(msg string, args ...interface{})
	Skipf(msg string, args ...interface{})
	Error(args ...interface{})
	Errorf(msg string, args ...interface{})
	Fatalf(msg string, args ...interface{})
	Failed() bool
	Name() string
}

TestLike is an interface that testing.T satisfies. All client functions accept a TestLike interface, with the intention of a `testing.T` being passed into them. However, the client may be used in non-test scenarios e.g benchmarks, which can then use the same client by just implementing this interface.

Jump to

Keyboard shortcuts

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