packutil

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOverflow

func AddOverflow(t reflect.Type, assign bool)

AddOverflow generates two random instances of the integer type that are guaranteed to cause an overflow when added, and adds them. This function is expected to panic.

func AddSubCheck

func AddSubCheck(t reflect.Type) error

AddSubCheck generates two random instances of the integer type, adds y to x and checks that the result is not x, and then subtracts y from x and checks that the result is x again.

func AddZeroCheck

func AddZeroCheck(t reflect.Type) error

AddZeroCheck generates a random instances of the integer type and checks that it does not change after adding zero.

func JSONFuzz

func JSONFuzz(t reflect.Type)

JSONFuzz is the same as the Fuzz testing function exposed by surge, but it uses JSON.

func JSONMarshalUnmarshalCheck

func JSONMarshalUnmarshalCheck(t reflect.Type) error

JSONMarshalUnmarshalCheck is the same as the MarshalUnmarshalCheck testing function exposed by surge, but it uses JSON.

func SubUnderflow

func SubUnderflow(t reflect.Type, assign bool)

SubUnderflow generates two random instances of the integer type that are guaranteed to cause an underflow when subtracted, and subtracts them. This function is expected to panic.

func SubZeroCheck

func SubZeroCheck(t reflect.Type) error

SubZeroCheck generates a random instances of the integer type and checks that it does not change after subtracting zero.

Types

This section is empty.

Jump to

Keyboard shortcuts

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