restest

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package restest provides optional helpers for tests that use the production github.com/omcrgnt/res.Registry implementation (res.New, res.Global). Import only from test code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAll

func AddAll(reg res.Registry, values ...any) error

AddAll registers values in order. Stops and returns the first error.

func Must

func Must(err error)

Must panics if err is non-nil.

func MustAddAll

func MustAddAll(reg res.Registry, values ...any)

MustAddAll is AddAll that panics on error.

func Registry

func Registry() res.Registry

Registry returns a new empty registry (res.New).

func ResetGlobal

func ResetGlobal() res.Registry

ResetGlobal replaces res.Global with an empty registry and returns it. Use for tests that exercise the shared registry (e.g. after */use init).

func With

func With(values ...any) res.Registry

With returns a registry with values registered in order via res.Registry.Add.

func WithTagged

func WithTagged(v any, tags ...res.Tag) res.Registry

WithTagged returns a registry containing one value registered via res.Registry.AddWithTags.

Types

This section is empty.

Jump to

Keyboard shortcuts

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