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

testhook

package
v1.0.0-alpha.34 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package testhook carries the in-module hooks black-box tests (package pulse_test, or any test package outside the root directory) need from a *pulse.Pulse without the root facade exporting its engine handle or its test-only switches. It is test-only in spirit: no production code reads it, and nothing outside the module can import it.

The root package installs every hook in an init function in a non-test file (testhook_install.go), so a test binary built in any directory sees them. This package imports nothing from the root, so there is no import cycle; the *pulse.Pulse argument is therefore typed any.

Index

Constants

This section is empty.

Variables

View Source
var ForcePanicRecoveryOff func(off bool) (prev bool)

ForcePanicRecoveryOff sets the root package's test-only override that makes every instance pulse.New builds afterwards behave as if Options.DisablePanicRecovery were set, so an engine panic crashes the test that hit it instead of surfacing as a recovered PROCESSING_PANIC error. It returns the previous setting. It writes a package-level variable unsynchronised: call it from TestMain before m.Run (or from a serial test that restores the previous value), never alongside parallel tests. Installed by the root package's init.

View Source
var Service func(p any) *service.Service

Service returns the engine handle a *pulse.Pulse was built with, so a test can inspect extension-registry wiring (Extensions, ExtensionsSnapshot, InstanceSnapshot). Anything other than a non-nil *pulse.Pulse returns nil. Installed by the root package's init.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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