Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CatchExpectedError ¶
CatchExpectedError function is a helper function for use in unit tests. It expects an error value as its first argument, and a pointer to a testing.T struct as its second argument. If the error is not nil, the function logs the error and continues execution of the unit test. If the error is nil, the function panics with a message indicating that the code did not panic as expected. This function is used to verify that a particular code path produces an error in a unit test.
Types ¶
type MemoryBuffer ¶
type MemoryBuffer struct {
// contains filtered or unexported fields
}
MemoryBuffer has both Write and Close methods for use as io.WriteCloser when testing (instead of os.Stdout), so tests can assert.Equal results etc.
func NewMemoryBuffer ¶
func NewMemoryBuffer() *MemoryBuffer
func (*MemoryBuffer) Close ¶
func (b *MemoryBuffer) Close() error
func (*MemoryBuffer) String ¶
func (b *MemoryBuffer) String() string
Click to show internal directories.
Click to hide internal directories.