failfast

package
v0.0.0-...-b5d9cbe Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package failfast provides a utility to track test failures and fail fast.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

Counter counts test failures and aborts test execution if it passes a given threshold. nil is a valid Counter that never aborts test execution just as if it has infinite threshold.

func NewCounter

func NewCounter(threshold int) *Counter

NewCounter constructs a Counter. If threshold is not positive, it returns nil, which is a valid Counter that never aborts test execution just as if it has infinite threshold.

func (*Counter) Check

func (c *Counter) Check() error

Check checks the current number of test failures against the threshold. If it is no less than the threshold, Check returns an error.

func (*Counter) Increment

func (c *Counter) Increment()

Increment increments the number of test failures.

Jump to

Keyboard shortcuts

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