testutil

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFileTree

func CreateFileTree(t *testing.T, root string, files map[string]string)

CreateFileTree creates multiple files from a map of path -> content.

func DirExists

func DirExists(path string) bool

DirExists checks if a directory exists.

func FileExists

func FileExists(path string) bool

FileExists checks if a file exists.

func ListFiles

func ListFiles(t *testing.T, root string) []string

ListFiles returns all files in a directory recursively.

func ReadFile

func ReadFile(t *testing.T, path string) string

ReadFile reads content from a file.

func TempDir

func TempDir(t *testing.T) string

TempDir creates a temporary directory and returns its path. The directory is automatically cleaned up when the test ends.

func WriteFile

func WriteFile(t *testing.T, path, content string)

WriteFile writes content to a file in the real filesystem.

Types

This section is empty.

Jump to

Keyboard shortcuts

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