test

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package test defines any testing constants or functions used to validate assumptions.

Index

Constants

View Source
const Seed int64 = 1234

Seed is a chosen value that should be used to seed pseudorandom number generators

Variables

This section is empty.

Functions

func DeepClone

func DeepClone(src, dest interface{})

DeepClone does a deep copy from one src to one dest Note: DeepClone copies only the public parts of a struct

func ForMethodNamed

func ForMethodNamed(s interface{}, m string) func(t *testing.T)

ForMethodNamed is a test helper that wraps a check for method by name

func MethodReturnsSelfType

func MethodReturnsSelfType(s interface{}, m string, args []interface{}) func(t *testing.T)

MethodReturnsSelfType checks that calling s.m(args...) return type s

func MethodReturnsType

func MethodReturnsType(s, r interface{}, m string, args []interface{}) func(t *testing.T)

MethodReturnsType checks that s.m(args...) returns type r

func RandomStringFromRunes

func RandomStringFromRunes(seed int64, n uint, valid []rune) string

RandomStringFromRunes generates a random string of length n from the supplied valid runes

func RandomWeightedString

func RandomWeightedString(seed int64, n uint, weights map[rune]uint) string

RandomWeightedString generates a random weighted string of length n. If n != sum(weights), an approximation is used

Types

This section is empty.

Jump to

Keyboard shortcuts

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