testutil

package
v0.33.12 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTestRunDir

func GetTestRunDir() string

GetTestRunDir returns the unique directory for this test run. It creates a directory in the system temp directory with a unique subdirectory based on the current timestamp and process ID. This ensures test directories are completely isolated from any git repository.

func StripYAMLCommentHeader added in v0.31.4

func StripYAMLCommentHeader(yamlContent string) string

StripYAMLCommentHeader removes the comment header from generated YAML files and returns only the non-comment YAML content. This is useful for tests that need to verify content without matching strings in the comment header.

func TempDir

func TempDir(t *testing.T, pattern string) string

TempDir creates a temporary directory for testing within the test run directory. It automatically cleans up the directory when the test completes. This replaces the use of os.MkdirTemp or t.TempDir() to ensure all test artifacts are isolated in a known location outside any git repository.

Types

This section is empty.

Jump to

Keyboard shortcuts

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