Documentation ¶
Overview ¶
Package testutil provides utilities for reading testdata from children directories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var FakeComponentData = `` /* 168-byte string literal not displayed */
FakeComponentData is simple fake component data string that should always parse.
Functions ¶
func ChangeToBazelDir ¶ added in v0.9.1
func ChangeToBazelDir(curDir string)
ChangeToBazelDir changes the CWD to a bazel directory if necessary. pathToDir specifies the path from the root bazel-directory to the relevant directory. If changing the directory fails, the method panics.
func CheckErrorCases ¶ added in v0.8.0
CheckErrorCases checks error cases for tests
Types ¶
type FakeReaderWriter ¶
FakeReaderWriter is a fake implementation of FileReaderWriter for unit tests. If a path is not in the PathToFiles, both reads and writes will fail.
func NewEmptyReaderWriter ¶
func NewEmptyReaderWriter() *FakeReaderWriter
NewEmptyReaderWriter creates an empty FakeReaderWriter. It will return an error on all paths returned from reads and writes.
func NewFakeReaderWriter ¶
func NewFakeReaderWriter(files map[string]string) *FakeReaderWriter
NewFakeReaderWriter returns a FakeReaderWriter that will fake a successful read/write when the given validFile is passed into the ReadBundleFile or WriteBundleFile functions.
func NewFakeReaderWriterFromPairs ¶
func NewFakeReaderWriterFromPairs(pairs ...*FilePair) *FakeReaderWriter
NewFakeReaderWriterFromPairs creates a map based on pairs of string inputs
func (*FakeReaderWriter) ReadFileObj ¶ added in v0.5.0
ReadFileObj reads a File proto object by deferring to the internal map.
Directories ¶
Path | Synopsis |
---|---|
Package componentsuite provides a test-suite helper for running component tests.
|
Package componentsuite provides a test-suite helper for running component tests. |