Skip to main content

Module test_utils

Module test_utils 

Source
Expand description

Test and benchmark utilities for generating random data.

This module provides helper functions for tests and benchmarks that need random data generation. These functions replace the functionality previously provided by winter-rand-utils.

§no_std Compatibility

This module provides both std-dependent and no_std-compatible functions:

For tests that should run in no_std mode, prefer using seeded_rng to obtain a deterministic RNG instead of rand::rng().

Structs§

ContinuousRng
A continuous random number generator that works in no-std contexts.

Functions§

prng_array
Generates a deterministic array using a PRNG seeded with the provided seed.
prng_value
Generates a deterministic value using a PRNG seeded with the provided seed.
prng_vector
Generates a deterministic vector using a PRNG seeded with the provided seed.
rand_array
Generates a random array of type T with N elements.
rand_value
Generates a random value of type T using the thread-local random number generator.
rand_vector
Generates a random vector of type T with the specified length.
seeded_rng
Creates a deterministic seeded RNG suitable for tests.