tests

package
v0.0.0-...-1fe2c9b Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Random provides a random source for tests.
	Random = rand.New(rand.NewSource(time.Now().Unix()))
)

Functions

func MustAbsolutePath

func MustAbsolutePath(path string, test *testing.T) string

MustAbsolutePath returns the absolute path to a file or fails the provided test.

func MustGenerate

func MustGenerate(tipe reflect.Type, test *testing.T) reflect.Value

MustGenerate generates and returns a random value of a type or fails a test.

func MustGenerateBytes

func MustGenerateBytes(test *testing.T) []byte

MustGenerateBytes generates a random slice of bytes or fails a test.

func MustGenerateHex

func MustGenerateHex(test *testing.T) string

MustGenerateHex generates a random hexidecimal string or fails a test.

func MustGenerateHexes

func MustGenerateHexes(test *testing.T) []string

MustGenerateHexes generates a random slice of hexidecimal strings or fails a test.

func MustGenerateInt

func MustGenerateInt(test *testing.T) int

MustGenerateInt generates a random integer or fails a test.

func MustGenerateString

func MustGenerateString(test *testing.T) string

MustGenerateString generates a random string or fails a test.

func MustGenerateStrings

func MustGenerateStrings(test *testing.T) []string

MustGenerateStrings generates a random slice of strings or fails a test.

func MustGenerateURL

func MustGenerateURL(test *testing.T) *url.URL

MustGenerateURL generates a random *url.URL or fails a test.

func MustGenerateUint

func MustGenerateUint(test *testing.T) uint

MustGenerateUint generates a random integer or fails a test.

func MustLoadX509KeyPair

func MustLoadX509KeyPair(certificate string, key string, test *testing.T) tls.Certificate

MustLoadX509KeyPair loads a tls.Certificate from PEM encoded key pair files or fails the test.

func MustRead

func MustRead(path string, test *testing.T) []byte

MustRead reads the content of a file or fails the provided test.

func MustTemplate

func MustTemplate(path string, values map[string]string, test *testing.T) []byte

MustTemplate returns the provided template rendered with the values or fails the test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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