metamon/generator/edges

Default edge values for the built-in generators. These are the “must-try” boundary inputs that the runner consumes before falling back to random generation. Curating a good edge set is the single biggest win for property-based testing on real-world code, so each builder here is documented with the rationale.

Values

pub fn floats_in(lo: Float, hi: Float) -> List(Float)

Edge floats in [lo, hi].

Includes lo, hi, 0.0, plus IEEE-754 bug magnets where representable: smallest positive subnormal-ish constants are not emitted to keep behaviour identical across BEAM and JS targets.

pub fn ints_in(lo: Int, hi: Int) -> List(Int)

Edge ints in the closed interval [lo, hi].

Always-tried candidates: 0, 1, -1, lo, hi. We also include “common bug magnets” (Int.max, Int.min, neighbouring values around 0) when they fall inside the range.

pub fn strings_ascii() -> List(String)

Edge ASCII strings.

Empty, single-space, single-tab, single-newline, common short fragments that frequently break tokenisers and Gleam-identifier generators (keywords, leading digit, plus/minus prefix).

pub fn strings_unicode() -> List(String)

Edge Unicode-aware strings.

Adds RTL/BiDi, an emoji, and U+0000 (NUL) which routinely breaks C-FFI bridges. Surrogate halves are intentionally not emitted — they are not valid Gleam strings.

Search Document