cli/mpfr_expr_cli API

cli/mpfr_expr_cli is the command-line runner for MPFR reference data. It reads one file, detects its format, parses and executes it with frontend/mpfr_expr and prints a summary. It is normally reached as floating-conformance --backend mpfr …. See the tutorial and the design page.

run

run(arguments) executes one invocation and returns the exit code.

pub fn run(Array[String]) -> Int

arguments[0] is the program name and is ignored. The runner accepts --json and exactly one path; anything else (including shard options, which are disabled for this runner) prints usage: mpfr-expr [--json] <MPFR sqrt, pow, or elementary corpus>.

The format is chosen from the file content:

Content containsFormatParser and executorJSON corpus
mpfr-elementary-v1elementary matrixparse_elementary_data, execute_elementary_datampfr-4.2.2-elementary
input_coefficient_hex (and not the above)integer powersparse_pow_data, execute_pow_datampfr-4.2.2-pow-si
neithersquare-root data_checkparse_sqrt_data, execute_sqrt_datampfr-4.2.2-sqrt

On a parse error the first diagnostic is printed as source:line:1: message. Text output prints a title, cases, passed cases, failed cases and one failed ID: MESSAGE line per failure. JSON output has the keys corpus, totalCases, passedCases, failedCases and failedIds.

Return value: 2 for usage, file or parse errors; 1 when a row failed; 0 otherwise.

///|
test "mpfr runner usage errors" {
  inspect(@mpfr_expr_cli.run(["mpfr"]), content="2")
  inspect(@mpfr_expr_cli.run(["mpfr", "--shard-count=2", "data.txt"]), content="2")
}

Complete public interface

// Generated using `moon info`, DON'T EDIT IT
package "Luna-Flow/floating/cli/mpfr_expr_cli"

// Values
pub fn run(Array[String]) -> Int

// Errors

// Types and methods

// Type aliases

// Traits