lemma 0.11.4

A pure, declarative language for business rules.
Documentation
---
nav_title: Engine test coverage
parent: Reference
nav_order: 55
---

# Engine test coverage

Numbers are produced by `cargo coverage engine`.

## Methodology

- Tool: [`cargo-llvm-cov`]https://github.com/taiki-e/cargo-llvm-cov driving [`cargo-nextest`]https://nexte.st/ on native (non-wasm) targets.
- Scope: `lemma-engine` library unit tests (`engine/src/**`) plus integration tests (`engine/tests/**`) via `cargo llvm-cov nextest -p lemma-engine --lib --tests`.
- Line, function, and region percentages come from LLVM source-based coverage.
- Each run starts with `cargo llvm-cov clean` on the target crate so repeated measurements stay deterministic.
- Tests run single-threaded (`NEXTEST_TEST_THREADS=1`) so coverage counters stay stable across runs.

### Out of scope

- `engine/src/wasm.rs` (built for `wasm32-unknown-unknown` only)
- Fuzz targets under `engine/fuzz/`
- Hex NIF (`lemma_hex`), LSP, OpenAPI, and CLI crates

## Environment

- Host: `Linux 7.2.15-1-omarchy x86_64`
- Rustc:

```
rustc 1.92.0 (ded5c06cf 2025-12-08)
binary: rustc
commit-hash: ded5c06cf21d2b93bffd5d884aa6e96934ee4234
commit-date: 2025-12-08
host: x86_64-unknown-linux-gnu
release: 1.92.0
LLVM version: 21.1.3
```

## Summary

| Metric | Covered | Total | Percent |
|--------|--------:|------:|--------:|
| Lines | 75265 | 85341 | 88.19% |
| Functions | 5808 | 6453 | 90.00% |
| Regions | 111933 | 128017 | 87.44% |

## Test run

- Total: 4693
- Passed: 4693
- Skipped: 0
- Failed: 0

## Per-module coverage

Sorted by line coverage ascending (weakest first). Only files under `src/` for this crate are listed.

| Module | Line % | Function % | Region % | Lines covered/total |
|--------|-------:|-----------:|---------:|--------------------:|
| `mcp/catalog.rs` | 0.00 | 0.00 | 0.00 | 0/179 |
| `lib.rs` | 6.45 | 9.09 | 6.86 | 4/62 |
| `mcp/error.rs` | 40.91 | 40.00 | 47.22 | 9/22 |
| `api/response.rs` | 51.19 | 83.33 | 48.46 | 43/84 |
| `computation/operation_result.rs` | 58.54 | 58.33 | 60.00 | 72/123 |
| `evaluation/expression.rs` | 60.92 | 66.67 | 67.77 | 53/87 |
| `computation/comparison.rs` | 72.63 | 87.50 | 67.50 | 130/179 |
| `api/value.rs` | 73.76 | 75.00 | 79.28 | 104/141 |
| `computation/bigint/signed.rs` | 76.68 | 72.50 | 74.18 | 217/283 |
| `computation/arithmetic.rs` | 76.83 | 72.55 | 73.40 | 756/984 |
| `documentation/mod.rs` | 77.22 | 76.92 | 78.63 | 61/79 |
| `mcp/tools.rs` | 80.13 | 71.43 | 78.95 | 383/478 |
| `planning/types.rs` | 81.99 | 87.46 | 84.91 | 4599/5609 |
| `planning/semantics.rs` | 82.25 | 84.51 | 81.83 | 6032/7334 |
| `computation/units.rs` | 82.48 | 100.00 | 79.61 | 193/234 |
| `error.rs` | 83.74 | 83.02 | 78.51 | 443/529 |
| `planning/graph.rs` | 85.49 | 90.23 | 85.63 | 11138/13028 |
| `parsing/lexer.rs` | 85.53 | 97.62 | 78.02 | 739/864 |
| `literals.rs` | 85.54 | 82.71 | 85.84 | 781/913 |
| `computation/datetime.rs` | 85.90 | 82.42 | 84.40 | 944/1099 |
| `result_value.rs` | 86.07 | 83.33 | 82.25 | 482/560 |
| `planning/execution_plan.rs` | 86.33 | 82.01 | 84.27 | 3974/4603 |
| `evaluation/narration.rs` | 86.78 | 75.93 | 85.88 | 2015/2322 |
| `spec_set_id.rs` | 87.72 | 100.00 | 95.52 | 50/57 |
| `computation/range.rs` | 88.10 | 94.12 | 83.33 | 185/210 |
| `api/show.rs` | 88.13 | 85.90 | 89.29 | 854/969 |
| `parsing/parser.rs` | 88.77 | 98.91 | 83.85 | 3526/3972 |
| `api/types.rs` | 88.80 | 96.77 | 90.44 | 317/357 |
| `evaluation/compute.rs` | 88.88 | 88.89 | 87.51 | 935/1052 |
| `planning/normalize.rs` | 89.07 | 91.10 | 88.16 | 2755/3093 |
| `planning/show_expression.rs` | 89.09 | 85.71 | 90.03 | 400/449 |
| `parsing/ast.rs` | 89.35 | 92.31 | 86.82 | 1359/1521 |
| `planning/ordered_dispatch.rs` | 89.87 | 94.44 | 89.18 | 408/454 |
| `string_distance.rs` | 90.48 | 83.33 | 93.22 | 57/63 |
| `evaluation/list_ops.rs` | 90.75 | 100.00 | 87.89 | 353/389 |
| `api/evaluate_data_json.rs` | 90.76 | 100.00 | 92.16 | 216/238 |
| `evaluation/tree.rs` | 91.22 | 91.58 | 89.97 | 1902/2085 |
| `planning/discovery.rs` | 91.39 | 98.04 | 92.46 | 1688/1847 |
| `parsing/arena.rs` | 92.03 | 88.00 | 92.27 | 254/276 |
| `evaluation/explanations.rs` | 92.07 | 92.31 | 91.21 | 697/757 |
| `computation/rational.rs` | 92.27 | 98.55 | 89.33 | 1206/1307 |
| `evaluation/mod.rs` | 92.31 | 84.80 | 90.96 | 2148/2327 |
| `formatting/mod.rs` | 92.56 | 100.00 | 91.28 | 1294/1398 |
| `planning/normalize/rewrite.rs` | 92.73 | 97.92 | 92.53 | 1339/1444 |
| `registry.rs` | 92.76 | 97.53 | 94.50 | 999/1077 |
| `parsing/mod.rs` | 92.96 | 99.26 | 89.22 | 2021/2174 |
| `planning/typing.rs` | 93.12 | 98.33 | 90.87 | 1082/1162 |
| `evaluation/rows.rs` | 93.21 | 87.50 | 92.31 | 151/162 |
| `limits.rs` | 93.27 | 100.00 | 83.45 | 97/104 |
| `formatting/expression.rs` | 93.45 | 98.48 | 93.52 | 871/932 |
| `engine.rs` | 93.49 | 92.41 | 93.32 | 2829/3026 |
| `quality.rs` | 93.96 | 97.80 | 90.60 | 887/944 |
| `planning/spec_value.rs` | 93.99 | 86.67 | 94.55 | 344/366 |
| `planning/mod.rs` | 94.46 | 95.49 | 95.17 | 1740/1842 |
| `planning/fill.rs` | 94.72 | 97.06 | 96.27 | 413/436 |
| `planning/spec_set.rs` | 94.80 | 92.31 | 96.57 | 164/173 |
| `planning/program.rs` | 94.88 | 96.88 | 94.78 | 500/527 |
| `computation/bigint/biguint.rs` | 95.62 | 98.63 | 93.28 | 721/754 |
| `evaluation/evaluate_data.rs` | 95.67 | 96.35 | 95.62 | 1945/2033 |
| `computation/measure_math.rs` | 96.13 | 100.00 | 94.14 | 149/155 |
| `deps.rs` | 96.23 | 100.00 | 96.47 | 51/53 |
| `evaluation/conversion_trace.rs` | 96.24 | 100.00 | 97.11 | 256/266 |
| `evaluation/response.rs` | 96.25 | 93.33 | 95.02 | 1051/1092 |
| `computation/decimal_math.rs` | 96.30 | 100.00 | 96.39 | 208/216 |
| `planning/unit_index.rs` | 96.49 | 96.75 | 96.19 | 1458/1511 |
| `planning/unit_family.rs` | 97.03 | 100.00 | 97.18 | 424/437 |
| `evaluation/lookup.rs` | 97.12 | 94.03 | 95.49 | 540/556 |
| `planning/instance_list.rs` | 97.13 | 95.79 | 95.51 | 980/1009 |
| `evaluation/branch_semantics.rs` | 97.32 | 100.00 | 91.67 | 109/112 |
| `parsing/source.rs` | 99.20 | 100.00 | 97.30 | 124/125 |
| `computation/bigint/alloc.rs` | 100.00 | 100.00 | 97.37 | 20/20 |
| `planning/explanation.rs` | 100.00 | 100.00 | 100.00 | 16/16 |

## Related docs

- [Engine integration test catalog]../../../engine/tests/README.md — qualitative map of scenarios and subsystem overlap clusters
- [CLI test coverage]cli.md
- [Engine benchmarks]../benchmarks/engine.md
<!-- coverage-input-digest: d250b87139772229 -->