eventbustest

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package eventbustest provides shared test helpers for modulex.EventBus adapter implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunHandlerErrorLoggingTests

func RunHandlerErrorLoggingTests(t *testing.T, newBus func(logger *slog.Logger) modulex.EventBus, topic string, timeout, logWait time.Duration)

RunHandlerErrorLoggingTests verifies that handler errors are logged and successful handlers are not logged as errors.

func RunPublishSubscribeTests

func RunPublishSubscribeTests(t *testing.T, newBus func() modulex.EventBus, topic string, timeout time.Duration)

RunPublishSubscribeTests exercises a basic publish/subscribe round-trip against the supplied EventBus factory.

Types

type SyncBuffer

type SyncBuffer struct {
	// contains filtered or unexported fields
}

SyncBuffer is a concurrency-safe io.Writer wrapping a bytes.Buffer. It is useful for capturing log output written by adapter goroutines while the test polls the buffer from the main goroutine.

func (*SyncBuffer) String

func (b *SyncBuffer) String() string

func (*SyncBuffer) Write

func (b *SyncBuffer) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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