testutil

package
v0.13.3-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplaceAddr

func ReplaceAddr(s string) string

ReplaceAddr replaces addresses on result output.

func ReplaceDateHeader

func ReplaceDateHeader(s string) string

ReplaceDateHeader replaces Date header on result output.

func ReplaceOutput

func ReplaceOutput(s string) string

ReplaceOutput replaces result output.

func ReplaceUserAgent

func ReplaceUserAgent(s string) string

ReplaceUserAgent replaces User-Agent header on result output.

func ResetDuration

func ResetDuration(s string) string

ResetDuration resets durations from result output.

func RunParameterizedTests

func RunParameterizedTests(r Reporter, e ParameterizedTestExecutor, files ...string)

RunParameterizedTests runs parameterized tests.

func ToPtr

func ToPtr[T any](t T) *T

ToPtr returns the pointer to t.

Types

type ParameterizedTestExecutor

type ParameterizedTestExecutor func(Reporter, func(interface{})) func(Reporter, interface{}) error

ParameterizedTestExecutor represents a executor for parameterized testing.

type Reporter

type Reporter interface {
	Fail()
	Failed() bool
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	Helper()
}

A Reporter is something that can be used to report test failures. It is satisfied by the standard library's *testing.T.

type TestParameter

type TestParameter struct {
	Name string        `yaml:"name"`
	YAML interface{}   `yaml:"yaml"`
	OKs  []interface{} `yaml:"ok"`
	NGs  []interface{} `yaml:"ng"`
}

TestParameter is a parameters for parameterized testing.

Jump to

Keyboard shortcuts

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