Documentation
¶
Index ¶
- func EqualDecimals(d1, d2 string) bool
- func NewSeed() int64
- func RandomDecimal(precision int, scale int) string
- func RandomEnum[T ~int](valueList []T) T
- func RandomEnumArray[T ~int](valueList []T) *maps.OrderedSet[T]
- func RandomNum[T constraints.Integer | constraints.Float](low int, high int) T
- func RandomNumberString() string
- func RandomValue[T any](size int) T
- func UseSeed(seed int64)
- type GobDecoder
- type GobEncoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EqualDecimals ¶
EqualDecimals returns true if d1 and d2 are equal decimal strings. Allows for the strings to have a leading + and any number of leading zeros, or trailing zeros after a decimal point.
func NewSeed ¶
func NewSeed() int64
NewSeed returns a new random seed for the random number generator.
func RandomDecimal ¶
func RandomEnum ¶
func RandomEnum[T ~int](valueList []T) T
func RandomEnumArray ¶
func RandomEnumArray[T ~int](valueList []T) *maps.OrderedSet[T]
func RandomNum ¶
func RandomNum[T constraints.Integer | constraints.Float](low int, high int) T
RandomNum provides a random number in the given range.
func RandomNumberString ¶
func RandomNumberString() string
func RandomValue ¶
RandomValue provides to the generated tests random values for types corresponding to ReceiverType Go types. For strings and []byte types, if size is 0, a size of 10 will be used as a reasonable limit. size will indicate the number of bytes or characters generated. times do not generate fractional seconds, since the value might be truncated depending on the sql dialect and data type.
Types ¶
type GobDecoder ¶
GobDecoder is a mock decoder that will emit an error after Count number of decodings. Before Count is reached, it will pass the decode on to the provided Decoder.
func (*GobDecoder) Decode ¶
func (r *GobDecoder) Decode(v any) error
type GobEncoder ¶
type GobEncoder struct {
Count int
}
GobEncoder is a mock writer that will emit an error after Count number of encodings.
func (*GobEncoder) Encode ¶
func (w *GobEncoder) Encode(v interface{}) error