mock

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrZB = fmt.Errorf("zero bytes written")

Functions

func ByteExample added in v0.7.5

func ByteExample() string

ByteExample saves a string of multibyte Unicode characters, tabs and newlines to a randomized, threadsafe filename. The path to the file is returned.

func FileExample

func FileExample(s string) string

FileExample saves the string to a randomized, threadsafe filename. The path to the file is returned.

func Filler

func Filler(sizeMB float64) string

Filler generates random us-ascii text.

func Input

func Input(input string) (*os.File, error)

Input returns a file pointer to a temporary file containing the input string.

func LargeExample

func LargeExample() string

LargeExample generates and saves a 800k file of filler us-ascii text to a randomized, threadsafe filename. The path to the file is returned.

func MegaExample

func MegaExample() string

MegaExample generates and saves a 1.5MB file of filler us-ascii text to a randomized, threadsafe filename. The path to the file is returned.

func SaveTemp

func SaveTemp(name string, b ...byte) (string, error)

SaveTemp saves bytes to a named temporary file.

func T

func T() map[string]string

T are short ASCII and Unicode strings used in various unit tests.

Types

type DirTests

type DirTests []struct {
	Name    string
	WantDir string
}

func NixTests

func NixTests(h, hp, s, w, wp string) DirTests

func WindowsTests

func WindowsTests(h, hp, s, w, wp string) DirTests

Jump to

Keyboard shortcuts

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