testhelpers

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestFile added in v0.98.0

func TestFile(t *testing.T, filename string, data []byte) string

TestFile creates a temporary file with the given filename, data and with the default permissions. The directory is automatically removed when the test and all its subtests complete. Each subsequent call to t.TempDir returns a unique directory.

func TestFileWithCustomPermissions added in v1.0.5

func TestFileWithCustomPermissions(t *testing.T, filename string, data []byte, perms fs.FileMode) string

TestFileWithCustomPermissions creates a temporary file with the given filename and permissions. The directory is automatically removed when the test and all its subtests complete. Each subsequent call to t.TempDir returns a unique directory.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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