testutil

package
v2.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const FooChecksum = "f7fa712caea646575c920af17de3462fe9d08d7fe062b9a17010117d5fa4ed88"

FooChecksum is the checksum of downloadablesPath("foo.tar.gz")

Variables

This section is empty.

Functions

func AssertEqualFiles

func AssertEqualFiles(t testing.TB, want, actual string) bool

AssertEqualFiles asserts two files are equal

func ChDir added in v2.4.3

func ChDir(t *testing.T, dir string)

ChDir changes the working directory for the duration of the test

func DownloadablesPath

func DownloadablesPath(path string) string

DownloadablesPath path to testdata/downloadables

func MustReadFile

func MustReadFile(t *testing.T, filename string) []byte

MustReadFile reads a file or fails

func MustWriteFile

func MustWriteFile(t *testing.T, filename string, content []byte)

MustWriteFile write a file or fails

func ProjectPath

func ProjectPath(path ...string) string

ProjectPath exchanges a path relative to the project root for an absolute path

func ProjectRoot

func ProjectRoot() string

ProjectRoot returns the absolute path of the project root

func ServeFile

func ServeFile(t *testing.T, file, path, query string) *httptest.Server

ServeFile starts an http server

func TmpDir

func TmpDir(t *testing.T) string

TmpDir returns the path to a newly created tmp dir and a function for deleting that dir

Types

This section is empty.

Jump to

Keyboard shortcuts

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