testenv

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 9 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

Overview

Package testenv keeps test binaries away from the developer's real moa configuration. A package that can reach pkg/core calls Run from TestMain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertNotProtected

func AssertNotProtected(tb testing.TB, path string)

AssertNotProtected stops a test that was pointed at the real config by an environment variable before it reads or writes there.

func Check

func Check(path string)

Check panics when path is, or is inside, a config location the harness protects.

func Run

func Run(m *testing.M) (code int)

Run replaces HOME, XDG_CONFIG_HOME and MOA_CONFIG_DIR with a private sandbox, makes core refuse to resolve any config path inside the incoming HOME or MOA_CONFIG_DIR, runs the tests and removes the sandbox. The environment is not restored afterwards: work that outlives a test stays sandboxed too.

Types

This section is empty.

Jump to

Keyboard shortcuts

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