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 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

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