test

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStatic = errors.New("static test error")

ErrStatic is an error used for testing purposes only

Functions

func AssertBytesEqual

func AssertBytesEqual(t *testing.T, a, b []byte, contextArgs ...interface{}) bool

AssertBytesEqual can be used to (test) assert that two byte slices are equal logging a message with context and stacktrace if false.

func AssertBytesNotEqual

func AssertBytesNotEqual(t *testing.T, a, b []byte, contextArgs ...interface{}) bool

AssertBytesNotEqual can be used to (test) assert that two byte slices are not equal logging a message with context and stacktrace if false.

func AssertEqual

func AssertEqual(t *testing.T, a, b interface{}, contextArgs ...interface{}) bool

AssertEqual can be used to (test) assert that 2 values are deep (reflect) equal, logging a message with context and stacktrace if false

func AssertEqualAny

func AssertEqualAny(t *testing.T, a interface{}, possibilities []interface{}, contextArgs ...interface{}) bool

AssertEqualAny can be used to (test) assert that a value is deep (reflect) equal with any of the given possibilities, logging a message with context and stacktrace if false

func AssertError

func AssertError(t *testing.T, err error, contextArgs ...interface{}) bool

AssertError can be used to (test) assert if an error is non-nil, logging a message with context and stacktrace if false

func AssertFalse

func AssertFalse(t *testing.T, b bool, contextArgs ...interface{}) bool

AssertFalse can be used to (test) assert that a boolean is true logging a message with context and stacktrace if false.

func AssertIsError

func AssertIsError(t *testing.T, err error, target error, contextArgs ...interface{}) bool

AssertIsError can be used to (test) assert if an error is a specific kind of error, logging a message with context and stacktrace if false

func AssertIsNotError

func AssertIsNotError(t *testing.T, err error, target error, contextArgs ...interface{}) bool

AssertIsNotError can be used to (test) assert if an error is not a specific kind of error, logging a message with context and stacktrace if false

func AssertNil

func AssertNil(t *testing.T, a interface{}, contextArgs ...interface{}) bool

AssertNil can be used to (test) assert that a value is nil, logging a message with context and stacktrace if false.

func AssertNoError

func AssertNoError(t *testing.T, err error, contextArgs ...interface{}) bool

AssertNoError can be used to (test) assert if an error is nil, logging a message with context and stacktrace if false

func AssertNoErrorFatal

func AssertNoErrorFatal(t *testing.T, err error, contextArgs ...interface{}) bool

AssertNoErrorFatal can be used to (test) assert if an error is nil, logging a message with context and stacktrace if true, and halting the program afterwards.

func AssertNotEqual

func AssertNotEqual(t *testing.T, a, b interface{}, contextArgs ...interface{}) bool

AssertNotEqual can be used to (test) assert that 2 values are not deep (reflect) equal, logging a message with context and stacktrace if false.

func AssertNotEqualShallow

func AssertNotEqualShallow(t *testing.T, a, b interface{}, contextArgs ...interface{}) bool

AssertNotEqualShallow can be used to (test) assert that two values are by value equal or by pointer, logging a message with context and stacktrace if false.

func AssertNotNil

func AssertNotNil(t *testing.T, a interface{}, contextArgs ...interface{}) bool

AssertNotNil can be used to (test) assert that a value is not nil, logging a message with context and stacktrace if false.

func AssertTrue

func AssertTrue(t *testing.T, b bool, contextArgs ...interface{}) bool

AssertTrue can be used to (test) assert that a boolean is false logging a message with context and stacktrace if true.

Types

type Logger

type Logger struct{}

Logger is a `bqwriter/log.Logger` implementation for (unit) testing purposes only.

func (Logger) Debug

func (Logger) Debug(_args ...interface{})

Debug implements bqwriter/log.Logger.Debug

func (Logger) Debugf

func (Logger) Debugf(_template string, _args ...interface{})

Debugf implements bqwriter/log.Logger.Debugf

func (Logger) Error

func (Logger) Error(_args ...interface{})

Error implements bqwriter/log.Logger.Error

func (Logger) Errorf

func (Logger) Errorf(_template string, _args ...interface{})

Errorf implements bqwriter/log.Logger.Errorf

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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