streamtest

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package streamtest provides a reusable behavioral suite for contract stream adapters. It is intended for adapter tests, not production call paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verify

func Verify[Send, Receive any](
	t *testing.T,
	open OpenFunc[Send, Receive],
	config contract.StreamConfig,
	inputs []Send,
	echo func(Send) Receive,
)

Verify runs the transport-neutral lifecycle, ordering, cancellation, slow-consumer delivery, transaction, context-firewall, terminal-error, root-cancellation, max-duration, and idle checks against a bidi adapter. It requires at least one input value and a deterministic echo mapper. The adapter is responsible for mapping the supplied handler to its test server. Exact queue blocking, process-local error causes, and remote-handler close budgets are transport-specific and should be asserted by the adapter's own tests.

Types

type OpenFunc

type OpenFunc[Send, Receive any] func(
	context.Context,
	contract.StreamConfig,
	contract.StreamHandler[Send, Receive],
) (contract.ClientStream[Send, Receive], error)

OpenFunc adapts a transport's stream opener to the conformance suite. An implementation may start a local server or test fixture before returning its ClientStream; the supplied handler defines that fixture's server behavior.

Jump to

Keyboard shortcuts

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