test

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(t *testing.T, s, substr string)

Contains reports whether a substr is inside s

func CreateTempFile

func CreateTempFile(t *testing.T, data string) string

func Equal

func Equal[A any](t *testing.T, expected, received A)

Equal asserts expected and received have deep equality

func False

func False(t *testing.T, val bool)

func GetFileContent added in v0.4.8

func GetFileContent(t *testing.T, name string) string

GetFileContent returns the contents of a file

it errors if file doesn't exist

func Nil

func Nil(t *testing.T, val any)

func NoError added in v0.4.8

func NoError(t *testing.T, err error)

func True

func True(t *testing.T, val bool)

Types

type MockTestingT

type MockTestingT struct {
	MockHelper  func()
	MockName    func() string
	MockSkip    func(...any)
	MockSkipf   func(string, ...any)
	MockSkipNow func()
	MockError   func(...any)
	MockLog     func(...any)
	MockCleanup func(func())
	// contains filtered or unexported fields
}

func NewMockTestingT added in v0.5.0

func NewMockTestingT(t *testing.T) MockTestingT

NewMockTestingT returns a MockTestingT with common default values

func (MockTestingT) Cleanup added in v0.5.0

func (m MockTestingT) Cleanup(f func())

func (MockTestingT) Error

func (m MockTestingT) Error(args ...any)

func (MockTestingT) Helper

func (m MockTestingT) Helper()

func (MockTestingT) Log

func (m MockTestingT) Log(args ...any)

func (MockTestingT) Name

func (m MockTestingT) Name() string

func (MockTestingT) Skip

func (m MockTestingT) Skip(args ...any)

func (MockTestingT) SkipNow

func (m MockTestingT) SkipNow()

func (MockTestingT) Skipf

func (m MockTestingT) Skipf(format string, args ...any)

Jump to

Keyboard shortcuts

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