luci: go.chromium.org/luci/common/testing/testfs Index | Files

package testfs

import "go.chromium.org/luci/common/testing/testfs"

Index

Package Files

build.go tempdir.go

func Build Uses

func Build(base string, layout map[string]string) error

Build constructs a filesystem hierarchy given a layout.

The layouts keys should be ToSlash-style file paths. Its values should be the content that is written at those paths. Intermediate directories will be automatically created.

To create a directory, end its path with a "/". In this case, the content will be ignored.

func MustWithTempDir Uses

func MustWithTempDir(t *testing.T, prefix string, fn func(string)) func()

MustWithTempDir calls WithTempDir and panics if any failures occur.

func WithTempDir Uses

func WithTempDir(t *testing.T, prefix string, fn func(string) error) error

WithTempDir creates a temporary directory and passes it to fn. After fn exits, the directory is cleaned up.

Package testfs imports 6 packages (graph). Updated 2018-12-18. Refresh now. Tools for package owners.