test

package
v0.0.0-...-7234002 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TempDir = func() string {
	abs, err := fs.AbsPath(os.TempDir())
	if err != nil {
		panic(err)
	}
	return abs
}()

The absolute path (after following symlinks) of os.TempDir()

Functions

func AppendToFile

func AppendToFile(t *testing.T, filepath, str string)

func CleanupTempFiles

func CleanupTempFiles()

func CreateLargeTempFile

func CreateLargeTempFile(t *testing.T) (path string)

Write a 500KB file to the TempDir and return the path.

func CreateTempDir

func CreateTempDir(t *testing.T) (path string)

func CreateTempFile

func CreateTempFile(t *testing.T) (path string)

Write a 50 byte file to the TempDir and return the path.

func RandBytes

func RandBytes(n int) (b []byte)

func RandSHA1

func RandSHA1() (out [sha1.Size]byte)

func RandSeed

func RandSeed(seed int)

func RandString

func RandString(n int) string

func RandWords

func RandWords(n int) []byte

func TouchFileTime

func TouchFileTime(t *testing.T, filepath string, ts time.Time)

Types

This section is empty.

Jump to

Keyboard shortcuts

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