Documentation
¶
Index ¶
Constants ¶
const ( // TestFixturesDir is the standard directory name for test fixtures. // This follows the Go convention of using "testdata" for test assets. TestFixturesDir = "testdata" // LegacyTestFixturesDir is the previous directory name used for test fixtures. // Files here will be automatically migrated to TestFixturesDir when accessed. LegacyTestFixturesDir = "test-fixtures" // GoldenFileDirName is the subdirectory within TestFixturesDir for golden files. GoldenFileDirName = "snapshot" // GoldenFileExt is the file extension for golden files. GoldenFileExt = ".golden" )
Variables ¶
var ( // GoldenFileDirPath is the full relative path to the golden files directory. GoldenFileDirPath = filepath.Join(TestFixturesDir, GoldenFileDirName) )
Functions ¶
func DangerText ¶
DangerText wraps text in ANSI escape codes for reverse red to make it highly visible.
func GetFixturePath ¶
GetFixturePath returns the path to a test fixture, automatically migrating from the legacy "test-fixtures" directory to "testdata" if needed. The migration happens transparently on first access.
func GetTestFixturesDir ¶
GetTestFixturesDir returns the fixture directory path, automatically migrating from the legacy "test-fixtures" directory if needed. This is useful for cases like afero.NewBasePathFs where you need the entire fixtures directory as a base.
func OpenDescriptorCount ¶ added in v0.3.2
OpenDescriptorCount reports how many file descriptors this process currently holds. Use it to assert that a code path released what it opened: on unix a leaked descriptor is otherwise invisible, since unlinking a file succeeds while a handle to it is still open.
Reads /dev/fd with Readdirnames rather than os.ReadDir, which stats each entry and fails on darwin for the directory handle doing the reading.
Types ¶
This section is empty.