testhelpers

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package testhelpers contains file system generators for use in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FSWithFiles

func FSWithFiles(t *testing.T, files map[string]string) hackpadfs.FS

FSWithFiles returns an FS with the given files contents generated inside it. The contents are trimmed and a newline appended for convenient comparisons.

func FromOSToFS added in v0.1.4

func FromOSToFS(t *testing.T, osPath string) (*os.FS, string)

FromOSToFS returns the FS and FS path for the given OS path. If using Windows, the os.FS used will target the osPath's volume (e.g. C:\) before converting.

func OSFSWithTemp

func OSFSWithTemp(t *testing.T) (fs hackpadfs.FS, workingDir, tempDir string)

OSFSWithTemp returns an os.FS instance with 1) the current module's directory and 2) a temporary directory mounted inside. Returns the FS paths to both mounts.

Types

This section is empty.

Jump to

Keyboard shortcuts

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