String Generation Ordering
String generation returns the strings a Term matches in a fixed order. The options on this page change which of them come first.
Every example uses the same pattern: (alpha|beta|prod)-[a-z0-9]{4}.
Path order
A path is one of the shapes the Term allows, as opposed to the characters filling it. beta-____ and prod-____ are two different paths through the same language. pathOrder decides the order in which paths are scheduled:
sweep(default): expand one path in full, shortest first, before moving to the next one. The cheapest way to page through a whole language withoffset.interleave: cover every path the Term holds before any path is asked for a second string. Slower thansweep, but better suited to deriving test cases from a smalllimit.shuffled:interleavewith same-length paths visited in an order drawn by the seed. Shorter paths still come first, so the seed only draws among paths of equal length.
Code
Character order
characterOrder decides which strings within each path come first:
ascending(default): fill each position from the low end of its character range, giving0000,0001and so on.shuffled: use a permutation drawn from the seed, so the strings look like real data while staying reproducible.
Code
Seeds and reproducibility
The shuffled modes are not random. The seed has a fixed default, so two calls sharing a seed generate exactly the same strings, and offset pages through them without repeats or gaps. Change the seed to draw a different sequence from the same Term.
The seed is ignored unless a shuffled mode is in use, and the exact sequence a given seed produces may change between releases.
Code
A seed makes the ordering reproducible. Consistent pagination across calls still requires the Term itself to be deterministic. See Determinism.
Realistic test data
Combining the three options gives diverse, natural-looking, reproducible fixtures: interleave the paths so every shape appears once, shuffle the characters so nothing looks like a counter, and fix the seed so your test suite sees the same data every run.
Code
Try the orderings interactively in the live demo.