encodertest

package module
v0.0.0-...-14c2e31 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2019 License: MIT Imports: 10 Imported by: 0

README

encodertest

Test utilities for the skycoin encoder

Build Status GoDoc

Documentation

Overview

Package encodertest provides test helpers for testing package encoder

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IgnoreAllUnexported

func IgnoreAllUnexported() cmp.Option

IgnoreAllUnexported returns an Option that only ignores the all unexported fields of a struct and its descendents, including anonymous fields of unexported types,

func PopulateRandom

func PopulateRandom(obj interface{}, rand *mathrand.Rand, options PopulateRandomOptions) error

PopulateRandom constructs an object with random data. This is used by the autogenerated skyencoder tests and can be useful in other testing.

Types

type PopulateRandomOptions

type PopulateRandomOptions struct {
	// Maximum random length for strings, slices, maps. If a string, slice or map has a `maxlen` struct tag, the lesser of the two will be used
	MaxRandLen int
	// Minimum random length for strings, slices, maps
	MinRandLen int
	// Leave slices as nil if they are empty
	EmptySliceNil bool
	// Leaves maps as nil if they are empty
	EmptyMapNil bool
	// Leave an omitempty field empty
	ForceEmptyOmitEmpty bool
	// Don't populate maps
	IgnoreMaps bool
}

PopulateRandomOptions are configuration options for the PopulateRandom method

Jump to

Keyboard shortcuts

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