Documentation
¶
Index ¶
- func AssertDirPath(tb testing.TB, path string, value any)
- func AssertFilePath(tb testing.TB, path string, value any)
- func AssertPaths(tb testing.TB, base string, files map[string]any)
- func CurrentDir() string
- func InTempDir(tb testing.TB, handler func(dir string))
- func MkdirAll(tb testing.TB, path string, perm fs.FileMode)
- func RemoveAll(tb testing.TB, path string)
- func WriteFile(tb testing.TB, path string, data []byte, perm fs.FileMode)
- func WritePaths(tb testing.TB, base string, files map[string]any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertDirPath ¶
AssertDirPath asserts the existence of a directory path.
- If value is true, then the directory SHOULD exist
- If value is false, then the directory SHOULD NOT exist.
func AssertFilePath ¶
AssertFilePath asserts the existence of a file path.
- If value is false, then the file SHOULD NOT exist.
- If value is a string, then the file contents should match.
- If value is an int, then file permissions should match.
func AssertPaths ¶
AssertPaths asserts each key in files relative to base. Calls AssertDirPath if the key ends in "/", otherwise calls AssertFilePath.
func MkdirAll ¶
MkdirAll delegates to os.MkdirAll and panics on error. The directory path will be removed when the test exits.
func WriteFile ¶
WriteFile delegates to os.WriteFile and panics on error. The file path will be removed when the test exits.
func WritePaths ¶
WritePaths creates a file for each key in files relative to base.
- The content of the file will be the map value.
- If the map key ends in a "/", then a directory will be created instead.
- Any failure to create will panic.
- All files and directories will be removed when the test exits.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.