testutil

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessAlive

func ProcessAlive(pid int) bool

ProcessAlive reports whether pid still names a live process. It is intended only for lifecycle tests that own the child process being inspected.

func WriteCommand

func WriteCommand(t testing.TB, dir, name, posixBody, windowsBody string) string

Types

type ChunkCancelRecorder

type ChunkCancelRecorder struct {
	EventRecorder
	// contains filtered or unexported fields
}

ChunkCancelRecorder records events and invokes cancel after every requested raw stream has delivered at least one non-empty chunk. It lets cancellation tests synchronize on observed process output instead of machine-dependent startup delays.

func NewChunkCancelRecorder

func NewChunkCancelRecorder(cancel func(), streams ...string) *ChunkCancelRecorder

func (*ChunkCancelRecorder) Emit

func (r *ChunkCancelRecorder) Emit(event driver.RunEvent) error

type EventRecorder

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

func (*EventRecorder) Emit

func (r *EventRecorder) Emit(event driver.RunEvent) error

func (*EventRecorder) EmitStream

func (r *EventRecorder) EmitStream(payload driver.StreamPayload) error

func (*EventRecorder) Snapshot

func (r *EventRecorder) Snapshot() []driver.RunEvent

func (*EventRecorder) StreamSnapshot

func (r *EventRecorder) StreamSnapshot() []driver.StreamPayload

StreamSnapshot returns a copy of every StreamPayload recorded so far. Useful for asserting adapter stream output in tests.

Directories

Path Synopsis
Package apifreeze provides stable public API snapshots for contract tests.
Package apifreeze provides stable public API snapshots for contract tests.

Jump to

Keyboard shortcuts

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