prng

package
v0.0.0-...-4b711b1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenSeed

func GenSeed(t *testing.T) int64

Types

type Prng

type Prng struct{}

This re-exports the global random state, exposed by rand (the package)'s exported methods, in a way that can be passed to faker.NewWithSeed().

func Seed

func Seed(t *testing.T) *Prng

Seed allows for repeating a certain (failing) test case by exposing the value used for seeding its PRNG. Dually, it's accepting a seed value from the TEST_SEED env var. Note: this doesn't affect the map iteration order; so we're not perfectly reproducible. However, given a test failure, there's less moving parts hindering the debug process.

func (*Prng) Int63

func (*Prng) Int63() int64

func (*Prng) Seed

func (*Prng) Seed(i int64)

Jump to

Keyboard shortcuts

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