test

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertDeepCopyEqual

func AssertDeepCopyEqual(t *testing.T, a any, b any)

AssertDeepCopyEqual checks to see if two variables have the same values but DO NOT share any memory There is currently a special case for `time.loc` (as this code traverses into unexported fields)

func NewJSONLoggerWithOutput added in v1.11.0

func NewJSONLoggerWithOutput(w io.Writer, level slog.Level) *slog.Logger

NewJSONLoggerWithOutput returns a *slog.Logger emitting JSON to w with timestamps suppressed, for tests that pin the JSON shape.

func NewLogger

func NewLogger() *slog.Logger

NewLogger returns a *slog.Logger suitable for use in tests. Output goes to io.Discard by default; set TEST_LOGS=1 (info), 2 (debug), or 3 (trace) to stream output to stderr for local debugging.

func NewLoggerWithOutput added in v1.11.0

func NewLoggerWithOutput(w io.Writer) *slog.Logger

NewLoggerWithOutput returns a *slog.Logger whose text output is captured by w. Timestamps are suppressed so tests can assert on exact output without baking the current time into expected strings.

func NewLoggerWithOutputAndLevel added in v1.11.0

func NewLoggerWithOutputAndLevel(w io.Writer, level slog.Level) *slog.Logger

NewLoggerWithOutputAndLevel is NewLoggerWithOutput with an explicit level so tests can exercise Enabled-gated paths.

Types

This section is empty.

Jump to

Keyboard shortcuts

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