testutil

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

CANARY: REQ=ENG-4319; FEATURE="TestInfrastructure"; ASPECT=Storage; STATUS=IMPL; UPDATED=2025-10-18

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chdir

func Chdir(t *testing.T, dir string) func()

Chdir changes to a directory and returns a cleanup function to restore

func FileExists

func FileExists(path string) bool

FileExists checks if a file exists at the given path

func SetupProjectDir

func SetupProjectDir(t *testing.T, dir string) error

SetupProjectDir creates a project directory with .canary subdirectory

func TempDir

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

TempDir creates a temporary directory for testing Returns the path and a cleanup function

func TempDirB

func TempDirB(b *testing.B) (string, func())

TempDirB creates a temporary directory for benchmarking Returns the path and a cleanup function

func TempHomeDir

func TempHomeDir(t *testing.T) (string, func())

TempHomeDir creates a temporary HOME directory for testing Returns the original HOME value and a cleanup function

func TempHomeDirB

func TempHomeDirB(b *testing.B) (string, func())

TempHomeDirB creates a temporary HOME directory for benchmarking Returns the original HOME value and a cleanup function

Types

type TB

type TB interface {
	Helper()
	Fatalf(format string, args ...interface{})
}

TB is an interface that covers both *testing.T and *testing.B

Jump to

Keyboard shortcuts

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