package localizertest

import "sigs.k8s.io/kustomize/api/testutils/localizertest"

Index

Functions

func CheckFs

func CheckFs(t *testing.T, dir string, expected, actual filesys.FileSystem)

CheckFs checks actual, the real file system, against expected, a file system in memory, for contents in directory dir. CheckFs does not allow symlinks.

func PrepareFs

func PrepareFs(t *testing.T, dirs []string, files map[string]string) (
	memory, actual filesys.FileSystem, test filesys.ConfirmedDir)

PrepareFs returns an in-memory and the actual file system, both with the test directory with the file content mapping in files. dirs are the directory paths that need to be created to write the files.

func SetWorkingDir

func SetWorkingDir(t *testing.T, workingDir string)

SetWorkingDir sets the working directory to workingDir and restores the original working directory after test completion.

func SetupDir

func SetupDir(t *testing.T, fSys filesys.FileSystem, dir string,
	files map[string]string)

SetupDir creates each file, specified by the file name to content mapping in files, under dir on fSys

Source Files

filesystem.go

Version
v0.20.0 (latest)
Published
Jun 28, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
7 hours ago

Tools for package owners.