testutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDummyBuf

func CreateDummyBuf(size int64) []byte

CreateDummyBuf creates a byte slice that is `size` big. It's filled with the repeating numbers [0...254].

func CreateFile

func CreateFile(size int64) string

CreateFile creates a temporary file in the systems tmp-folder. The file will be `size` bytes big, filled with content from CreateDummyBuf.

func CreateRandomDummyBuf

func CreateRandomDummyBuf(size, seed int64) []byte

CreateRandomDummyBuf creates data that is evenly distributed and therefore notirously hard to compress.

func DumbCopy

func DumbCopy(dst io.Writer, src io.Reader, useReadFrom, useWriteTo bool) (written int64, err error)

DumbCopy works like io.Copy but may be instructed to not use WriteTo or ReadFrom

func Remover

func Remover(t *testing.T, paths ...string)

Remover removes all files in paths recursively and errors when it fails. It is no error if there's nothing to delete. It's useful in defer statements.

Types

This section is empty.

Jump to

Keyboard shortcuts

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