Dune.Eval.Opts.validate-exclamation-mark

You're seeing just the function validate-exclamation-mark, go back to Dune.Eval.Opts module for more information.

Specs

validate!(Keyword.t() | map()) :: t()

Validates untrusted options from a keyword or a map and returns a Dune.Eval.Opts struct.

Examples

iex> Dune.Eval.Opts.validate!([])
%Dune.Eval.Opts{max_heap_size: 30_000, max_reductions: 30_000, timeout: 50}

iex> Dune.Eval.Opts.validate!(max_reductions: 10_000, max_heap_size: 10_000, timeout: 20)
%Dune.Eval.Opts{max_heap_size: 10_000, max_reductions: 10_000, timeout: 20}

iex> Dune.Eval.Opts.validate!(max_heap_size: 0)
** (ArgumentError) max_heap_size should be an integer > 0

iex> Dune.Eval.Opts.validate!(max_reductions: 0)
** (ArgumentError) max_reductions should be an integer > 0

iex> Dune.Eval.Opts.validate!(timeout: "55")
** (ArgumentError) timeout should be an integer > 0