fi

package
v0.0.0-...-46f0099 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind[T any, E any](f func(t T) E, t T) func() E

Bind converts a single-parameter function to a no-parameter one by binding the given value to the parameter. Useful together with NoErrorF or defer.

func NoErrorF

func NoErrorF(f func() error, t assert.TestingT)

NoErrorF fails the current test if f returns an error. Useful in defer.

func SkipLongTest

func SkipLongTest(t *testing.T)

SkipLongTest skips the current test when -short is set

Types

type Requirement

type Requirement[T any] struct {
	// contains filtered or unexported fields
}

Requirement associate checks with a value

func NoError

func NoError[T any](val T, err error) Requirement[T]

NoError defines a requirement that the result of the function is can be used and the associated error is nil

func (Requirement[T]) Require

func (r Requirement[T]) Require(t require.TestingT) T

Require returns the Requirement value if the check doesn't fail the current test

Jump to

Keyboard shortcuts

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