metamon/config

Configuration for property and metamorphic runs. Construct via default_config() and the with_* builders. All builders that validate input return a Result so misconfiguration is visible at the type level (no silent fallback).

Types

Opaque configuration record. Use default_config() and with_* to build instances.

pub opaque type Config

Errors returned by with_* builders for invalid inputs.

pub type ConfigError {
  NonPositive(field: String, value: Int)
  InvalidPath(path: String, reason: String)
}

Constructors

  • NonPositive(field: String, value: Int)

    A field that must be positive received a non-positive value.

  • InvalidPath(path: String, reason: String)

    A path field received an empty or otherwise invalid string.

Failure-report output format.

pub type OutputFormat {
  Text
  Json
}

Constructors

  • Text

    Multi-line human-readable text (the default).

  • Json

    Single-line JSON object suitable for CI annotations and LLM parsing.

Values

pub fn default_config() -> Config

Default configuration: 100 runs, max_size 99, random seed, etc.

pub fn diff_enabled(c: Config) -> Bool

Whether structural diff is shown in failure output.

pub fn max_edges(c: Config) -> Int

Cap on the size of the cartesian-product edge sets that combinators like tuple2 / map2 build up.

pub fn max_size(c: Config) -> Int

Upper bound on the Range size parameter; controls the complexity ramp from the first run to the last.

pub fn output_format(c: Config) -> OutputFormat

Selected failure-report format (Text or Json).

pub fn regression_file(c: Config) -> option.Option(String)

Path to the regression file; None disables the feature.

pub fn runs(c: Config) -> Int

The number of successful runs the runner targets per property.

pub fn seed(c: Config) -> seed.Seed

The seed used to drive the deterministic PRNG. with_seed pins this to a fixed value for reproducibility.

pub fn shrink_limit(c: Config) -> Int

Maximum number of shrink steps the runner attempts on a single failure before giving up.

pub fn with_diff_enabled(c: Config, enabled: Bool) -> Config

Enable or disable structural diff in failure output.

pub fn with_max_edges(
  c: Config,
  n: Int,
) -> Result(Config, ConfigError)

Override the cap on the size of edge cartesian products.

pub fn with_max_edges_or_panic(c: Config, n: Int) -> Config

Like with_max_edges, but panics with a structured message on invalid input. Intended for hard-coded test configuration.

pub fn with_max_size(
  c: Config,
  n: Int,
) -> Result(Config, ConfigError)

Override max_size.

pub fn with_max_size_or_panic(c: Config, n: Int) -> Config

Like with_max_size, but panics with a structured message on invalid input. Intended for hard-coded test configuration.

pub fn with_output_format(c: Config, fmt: OutputFormat) -> Config

Choose the failure-report output format. Text is the default; Json produces a single-line JSON object suitable for piping into CI dashboards or LLM-driven analysis.

pub fn with_regression_file(
  c: Config,
  path: String,
) -> Result(Config, ConfigError)

Set a regression file path. The file is created on first failure and read on every subsequent run.

pub fn with_regression_file_or_panic(
  c: Config,
  path: String,
) -> Config

Like with_regression_file, but panics with a structured message on invalid input. Intended for hard-coded test configuration.

pub fn with_runs(
  c: Config,
  n: Int,
) -> Result(Config, ConfigError)

Override the number of successful runs.

pub fn with_runs_or_panic(c: Config, n: Int) -> Config

Like with_runs, but panics with a structured message on invalid input. Intended for hard-coded test configuration where the bound is statically known.

pub fn with_seed(c: Config, s: seed.Seed) -> Config

Override the seed.

pub fn with_shrink_limit(
  c: Config,
  n: Int,
) -> Result(Config, ConfigError)

Override the shrink limit.

pub fn with_shrink_limit_or_panic(c: Config, n: Int) -> Config

Like with_shrink_limit, but panics with a structured message on invalid input. Intended for hard-coded test configuration.

Search Document