Expand description
Property-based generators for randomized test input. TODO: Move
into dedicated crate and access via
Property-based generators for Selection
and related types.
These strategies are used in proptest
-based tests to construct
randomized selection expressions for testing evaluation, routing,
and normalization logic.
The main entry point is [gen_selection(depth)
], which generates
a structurally diverse Selection
of bounded depth, supporting
the True
, Range
, All
, Union
, and Intersection
constructors.
Example usage:
use ndslice::strategy::gen_selection;
use proptest::prelude::*;
proptest! {
#[test]
fn test_selection(s in gen_selection(3)) {
// Use `s` as input to evaluation or routing tests
}
}
Functionsยง
- gen_
extent - Generate a random
Extent
withdims
dimensions, where each size is in1..=max_len
. - gen_
region - Generate a random
Region
strategy for property tests. - gen_
region_ strided - Generate a random
Region
strategy with striding for property tests. - gen_
selection - Recursively generates a random
Selection
expression of bounded depth, aligned with the given sliceshape
. - gen_
slice - Generates a random
Slice
with up tomax_dims
dimensions, where each dimension has a size between 1 andmax_len
(inclusive). - gen_
slice_ and_ subview - Generates a pair
(base, subview)
where: