conformance

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestLogger

type TestLogger interface {
	// Events returns all recorded events in the logger.
	Events() []logur.LogEvent
}

TestLogger acts as a recorder for the Logger under test.

type TestLoggerFunc

type TestLoggerFunc func() []logur.LogEvent

TestLoggerFunc converts an event function to a TestLogger if it's definition compatible with the interface.

func (TestLoggerFunc) Events

func (fn TestLoggerFunc) Events() []logur.LogEvent

type TestSuite

type TestSuite struct {
	LoggerFactory func(level logur.Level) (logur.Logger, TestLogger)

	NoTraceLevel bool
}

TestSuite runs a set of conformance tests against a logger.

func (TestSuite) Run

func (s TestSuite) Run(t *testing.T)

Run executes the complete test suite.

func (TestSuite) RunLevelContextTest

func (s TestSuite) RunLevelContextTest(t *testing.T)

RunLevelContextTest tests leveled logging capabilities of a LoggerContext. Note: this is not mandatory, incompatible loggers will be skipped.

func (TestSuite) RunLevelEnablerTest

func (s TestSuite) RunLevelEnablerTest(t *testing.T)

RunLevelEnablerTest tests enabled levels. Note: this is not mandatory, incompatible loggers will be skipped. nolint: gocognit

func (TestSuite) RunLevelTest

func (s TestSuite) RunLevelTest(t *testing.T)

RunLevelTest tests leveled logging capabilities of a Logger.

Jump to

Keyboard shortcuts

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