testutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 5 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 testutil holds helpers shared across the tests/ tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RepoRoot

func RepoRoot(tb testing.TB) string

RepoRoot returns the repository root directory, located by walking up from the caller's source file until a go.mod is found. Being depth-independent it works from any package under tests/ without a hard-coded "../.." offset that silently breaks when the test layout is reorganized.

func SyntheticCorpus

func SyntheticCorpus(n int) []string

SyntheticCorpus returns n synthetic secret-bearing prompt strings for masking tests and benchmarks. Each entry embeds real-looking secrets (email, IPv4, Stripe/npm keys, passwords) that trigger the shipped built-in rules across all five built-in data types, varied by index so distinct entries yield distinct placeholders while repeats exercise cross-text dedup. It is self-contained (no external data files), so masking tests stay green on any clean checkout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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