ptesting

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

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

Result provides some useful methods to write concise code in tests.

func R

func R[T any](v T, err error) *Result[T]

func (*Result[T]) Do

func (r *Result[T]) Do(f func(t *testing.T, it T)) *Result[T]

func (*Result[T]) Equal

func (r *Result[T]) Equal(v T, msgf ...any) *Result[T]

func (*Result[T]) EqualError

func (r *Result[T]) EqualError(t *testing.T, errStr string, msgf ...any) *Result[T]

func (*Result[T]) ErrorAs

func (r *Result[T]) ErrorAs(t *testing.T, target any, msgf ...any) *Result[T]

func (*Result[T]) ErrorContains

func (r *Result[T]) ErrorContains(t *testing.T, s string, msgf ...any) *Result[T]

func (*Result[T]) ErrorIs

func (r *Result[T]) ErrorIs(t *testing.T, target error, msgf ...any) *Result[T]

func (*Result[T]) NoError

func (r *Result[T]) NoError(t *testing.T, msgf ...any) *Result[T]

func (*Result[T]) V

func (r *Result[T]) V() T

Jump to

Keyboard shortcuts

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