Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileContentMap ¶
FileContentMap specifies files that should be created as part of a parser test.
Keys are slash-delimited paths.
type TestDir ¶
type TestDir struct {
// contains filtered or unexported fields
}
TestDir is a temporary directory for use in testing.
func NewTestDir ¶
func NewTestDir(t *testing.T, opts ...TestDirOpt) *TestDir
NewTestDir constructs a new temporary test directory.
The test directory is automatically cleaned at the end of the test.
type TestDirOpt ¶
TestDirOpt performs setup on the test directory in question.
func Chmod ¶
func Chmod(file string, perm os.FileMode) TestDirOpt
Chmod changes the permissions of the passed path to perm.
file is a slash-delimited path relative to the test directory root.
func Dir ¶
func Dir(dir string) TestDirOpt
Dir creates a directory inside the test directory if it does not exist.
dir is a slash-delimited relative path.
func DirContents ¶
func DirContents(contentMap FileContentMap) TestDirOpt
DirContents is a convenience method for writing many files inside the test directory.
func FileContents ¶
func FileContents(file string, contents string) TestDirOpt
FileContents writes a file called subPath with contents inside the test directory.
file is a slash-delimited path relative to the test directory root.