Help us shape the future of Go! Take the 2026 Go Developer Survey

eventstest

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 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 Handler

type Handler struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Handler is a stats handler that can record events for inspection and make assertions on them.

func (*Handler) AssertEvents

func (h *Handler) AssertEvents(t testing.TB, expectedEvents ...events.Event)

AssertEvents asserts that the given events were handled by the handler. It only checks the following event fields for equality — .Args, .Debug and .Message. It ignores the .Source and .Time fields.

func (*Handler) HandleEvent

func (h *Handler) HandleEvent(e *events.Event)

HandleEvent implements the events.Handler interface.

Jump to

Keyboard shortcuts

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