Gen
class Gen Import
Source: use arbitrary::{Gen}; compiler/src/prelude/arbitrary.hy A seeded source of random values. size bounds how big values get (ints in [-size, size], lengths up to size); coil test grows it from 0 so the first failures it finds are small.
Associated functions#
| Name | Description |
|---|---|
new | A generator seeded with seed (0 is replaced by a fixed non-zero seed), starting at size 10. |
Methods#
| Name | Description |
|---|---|
size | The current size bound. |
resize | Sets the size bound; negative sizes become 0. |
bits | 32 random bits. |
below | Uniform in [0, n); 0 when n <= 0. |
int_in | Uniform in [lo, hi]. |
one_in | True one time in n. |
len | How many elements a collection gets: up to size, none once the value is nested deep(). |
depth | How deep the value being built is nested in others. |
enter | Around the parts of a value. |
leave | Undoes one enter. |
deep | Past this depth derived enums stop nesting. |