Documentation
¶
Index ¶
- Constants
- Variables
- func Bytes(t *testing.T, got, wanted []byte, msgs ...any)
- func Error(t *testing.T, err error, msgs ...any)
- func Fail(t *testing.T, msgs ...any)
- func Float(t *testing.T, got, wanted float64, msgs ...any)
- func FloatDiff(t *testing.T, got, wanted, diff float64, msgs ...any)
- func Floats(t *testing.T, got, wanted []float64, msgs ...any)
- func Minify(t *testing.T, input string, err error, got, wanted string, msgs ...any)
- func String(t *testing.T, got, wanted string, msgs ...any)
- func T(t *testing.T, got, wanted any, msgs ...any)
- func That(t *testing.T, condition bool, msgs ...any)
- type EmptyReader
- type ErrorReader
- type ErrorWriter
- type InfiniteReader
- type PlainReader
Constants ¶
const ( Red = "\x1B[31m" Green = "\x1B[32m" Dark = "\x1B[2m" UndoDark = "\x1B[22m" Reset = "\x1B[0m" )
Variables ¶
var Epsilon = 1e-10
Epsilon is used for floating point comparison.
var ErrPlain = errors.New("error")
ErrPlain is the default error that is returned for functions in this package.
Functions ¶
Types ¶
type EmptyReader ¶
type EmptyReader struct {
}
EmptyReader implements an io.Reader that will always return 0, nil.
type ErrorReader ¶
type ErrorReader struct {
// contains filtered or unexported fields
}
ErrorReader implements an io.Reader that will do N successive reads before it returns ErrPlain.
func NewErrorReader ¶
func NewErrorReader(n int) *ErrorReader
NewErrorReader returns a new ErrorReader.
type ErrorWriter ¶
type ErrorWriter struct {
// contains filtered or unexported fields
}
ErrorWriter implements an io.Writer that will do N successive writes before it returns ErrPlain.
func NewErrorWriter ¶
func NewErrorWriter(n int) *ErrorWriter
NewErrorWriter returns a new ErrorWriter.
type InfiniteReader ¶
type InfiniteReader struct{}
InfiniteReader implements an io.Reader that will always read-in one character.
func NewInfiniteReader ¶
func NewInfiniteReader() *InfiniteReader
NewInfiniteReader returns a new InfiniteReader.
type PlainReader ¶
type PlainReader struct {
// contains filtered or unexported fields
}
PlainReader implements an io.Reader and wraps over an existing io.Reader to hide other functions it implements.
func NewPlainReader ¶
func NewPlainReader(r io.Reader) *PlainReader
NewPlainReader returns a new PlainReader.