testutils

package
v0.0.0-...-c4863fd Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package testutils provides an interface for handling testdata files.

Index

Constants

This section is empty.

Variables

View Source
var CreateTempFile func(name string) (string, *os.File, error)

CreateTempFile attempts to create a temporary file named |name|. On success, it returns the path and the File object for the new file. On failure, returns an error.

View Source
var GetSourceFilePath func(projectRootRelative string) string

GetSourceFilePath returns a full path to a source file given a relative path from the root of the project repository.

View Source
var ReadSourceFile func(projectRootRelative string) ([]byte, error)

ReadSourceFile is similar to GetSourceFilePath but returns the file contents instead of its path.

Functions

func CheckFilesEqual

func CheckFilesEqual(expectedFile, actualFile string) error

CheckFilesEqual ensures that the contents of the expected file has the same string contents, according to CheckStringsEqual, as the actual file.

func CheckStringsEqual

func CheckStringsEqual(expected, actual string) error

CheckStringsEqual ensures that the actual string matches the expected. If the strings match, returns nil. If they do not, returns an error describing the difference.

Types

This section is empty.

Jump to

Keyboard shortcuts

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