testutil

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package testutil provides common test utilities and helpers to reduce boilerplate in test files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockConfig

func NewMockConfig(t testing.TB, opts ...ConfigOption) config.Provider

NewMockConfig creates a config provider for testing with optional customizations.

func NewTestLogger

func NewTestLogger(t testing.TB) log.Logger

NewTestLogger creates a logger that writes to t.Logf for testing. This ensures test output is properly captured by the test framework.

Types

type ConfigOption

type ConfigOption func(*config.Settings)

ConfigOption allows customization of test config settings.

func WithRepositoryDir

func WithRepositoryDir(dir string) ConfigOption

WithRepositoryDir sets a custom repository directory.

func WithUserMode

func WithUserMode(userMode bool) ConfigOption

WithUserMode sets user mode.

func WithVerbose

func WithVerbose(verbose bool) ConfigOption

WithVerbose sets verbose logging.

Directories

Path Synopsis
Package fakerunner provides a fake implementation of execx.Runner for testing.
Package fakerunner provides a fake implementation of execx.Runner for testing.

Jump to

Keyboard shortcuts

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