Page
Library
Module
Module type
Parameter
Class
Class type
Source
This document summarizes what the committed tests and evidence runners prove for ecma-regex.
It is downstream of:
The test matrix maps requirement families to evidence. This audit explains the evidence layers, their default-vs-explicit role, and the remaining quality-hardening work that must not be mistaken for credited conformance.
The package-safe default test gate is:
opam exec -- dune runtestIt is intentionally self-contained so opam --with-test can run from a clean source archive without cache/ or external/ working artifacts. That suite includes:
The full local evidence gate is:
opam exec -- dune build @runtest @test/evidenceIt additionally runs ECMA-262 exact-plan tests, matcher and adapter evidence tests, generated UCD 16.0.0 tests, JSON Schema regex-facing corpus tests, test262-derived executable corpus tests, and coverage ledger/worklist invariant tests. This gate requires prepared cache/ outputs and downloaded external/ corpora and is therefore not part of opam package @runtest.
Default dune runtest is the installable package health gate. It is not, by itself, the whole conformance argument; the conformance argument also depends on the explicit evidence gate and generated ledger/corpus evidence described below.
These runners are evidence generators or evidence checkers. They are separate from ordinary unit-test intent because they construct or verify requirement coverage data.
Evidence runner | Role | Credited result |
|---|---|---|
| top-level ECMA-262 RegExp requirement ledger gate |
|
| checks committed test view of ledger invariants | coverage ledger invariants green |
| checks no remaining requirement-to-test worklist pressure |
|
| checks no selector gap backlog remains | selector gap rows are zero |
| checks exactness credit and open exactness classification |
|
| checks executable test262-derived evidence inventory |
|
| checks generated UCD 16.0.0 cases |
|
| checks raw UTF-16 inventory classification |
|
| checks generated raw UTF-16 behavior cases |
|
| checks regex-facing JSON Schema consumer corpus |
|
The ledger is the only layer that may summarize ECMA-262 requirement coverage as complete. Individual tests prove behavior; the ledger decides whether those tests are sufficient requirement-level credit.
Current ECMA-262 coverage result:
ecma262_snapshot=2026
ledger_rows=2020
direct_requirement_rows=2018
covered_rows=1770
non_applicable_rows=248
coverage_complete=trueCredited ECMA-262 evidence comes from:
The exactness audit reports:
exactness_credit_rows=1144
open_exactness_rows=410
potential_exact_ready_rows=0The 410 open exactness rows are the executable negative syntax corpus rows. They are deliberately not counted as ECMA-262 requirement credit until each row is mapped to a concrete requirement row or proved to duplicate an already credited requirement.
Product adapter evidence covers ECMA-262 RegExp behavior exposed through direct OCaml functions instead of JavaScript object/prototype dispatch.
Credited adapter rows:
search_adapter=16
match_adapter=25
match_all_adapter=16
split_adapter=52
replace_adapter=119
escape_adapter=32Evidence artifacts:
test/test_ecma262_search_adapter.mltest/test_ecma262_match_adapter.mltest/test_ecma262_match_all_adapter.mltest/test_ecma262_split_adapter.mltest/test_ecma262_replace_adapter.mltest/test_ecma262_escape_adapter.mlThese tests prove the explicit OCaml adapter API. They do not claim JavaScript object dispatch, prototype lookup, constructors, receiver coercion, or JavaScript callable replacement-function behavior.
Unicode behavior is pinned to UCD 16.0.0.
Required Unicode source files:
PropertyAliases.txtPropertyValueAliases.txtUnicodeData.txtCaseFolding.txtPropList.txtDerivedCoreProperties.txtDerivedNormalizationProps.txtScripts.txtScriptExtensions.txtemoji/emoji-data.txtGenerated runtime source:
lib/ecma_regex_ucd_tables.mlGeneration and test tools:
tools/build_ucd_tables.pytools/build_ucd_regexp_tests.pytest/test_ecma262_ucd_generated_cases.mlCurrent credited result:
ucd_version=16.0.0
ucd_generated_case_rows=366
ucd_coverage_credit_rows=366
ucd_alcotest_cases=17This evidence covers Unicode property aliases, property value aliases, Script/Script_Extensions membership, General_Category membership, binary properties, property escapes inside character classes, character-set membership, and simple/common case folding used by Unicode ignore-case matching.
Changing the Unicode version is a semantic change: the generator, runtime tables, UCD evidence, and conformance ledger must all be regenerated and rechecked together.
Raw UTF-16 evidence proves explicit ECMAScript String behavior where OCaml UTF-8 strings are not sufficient to observe the semantics.
Public surfaces covered:
js_stringjs_string_of_utf8js_string_of_utf16_code_unitsjs_string_to_utf16_code_unitsexec_jssearch_jssearch_index_jsexec_instance_jsiter_matches_jsnext_match_jsCurrent raw UTF-16 inventory:
rows=35
covered=32
open=0
non_applicable_with_reason=3
generated_cases=1625Evidence artifacts:
test/test_raw_utf16_coverage_matrix.mltest/test_raw_utf16_generated_cases.mltest/test_raw_utf16_result_slicing_matrix.mltest/test_raw_utf16_negative_position_matrix.mltest/test_raw_utf16_escape_matrix.mltest/test_api.mlThis evidence covers lone surrogates, valid surrogate pairs, Unicode code-point advancement, non-Unicode code-unit behavior, raw result slicing, captures over raw strings, iterator advancement, adapter variants, and RegExp.escape behavior over raw ECMAScript Strings.
JSON Schema is a consumer profile, not the governing regular-expression language source.
Covered JSON Schema regex-facing surfaces:
patternpatternPropertiesformat: regexCovered draft families:
Current corpus result:
corpus_cases=187
observed_pass=187
observed_fail=0
remaining_failure_worklist_rows=0The corpus proves that regex-facing JSON Schema consumer behavior is compatible with the ecma-regex public API. It does not define a separate regexp language and does not override ECMA-262 RegExp semantics.
The following are public OCaml contract rather than direct ECMA-262 requirements:
syntax_error = string;result, option, and list;Contract-only does not mean untested. Contract-only behavior is checked through the public signature and API tests, but its source of truth is the documented OCaml API rather than one-to-one JavaScript host object text.
Intentional exclusions are visible in the product-surface matrix and are not counted as matcher gaps.
Current exclusion family:
RegExp.prototype.compile host behavior.Where these areas have RegExp semantic equivalents, the semantic equivalent is tested through explicit OCaml adapter functions.
Package/install evidence is not ECMA-262 conformance evidence, but it proves the delivered package surface.
Current package gates:
opam lint ecma-regex.opamopam exec -- dune build @installopam install . --with-test --dry-run --yesopam exec -- dune build @doc in a switch with odoc availableopam install . --with-test --with-doc --dry-run --yes in a switch where the documentation dependency can be solvedThese gates prove metadata sanity, install artifact construction, documentation buildability in an odoc-capable switch, and opam solver/package dry-run behavior. They do not add ECMA-262 semantic coverage credit.
Current follow-up:
negative_syntax_executable_rows=410
negative_syntax_requirement_linked_rows=0
negative_syntax_coverage_credit_rows=0This is not a known runtime mismatch. It is a stricter evidence-accounting task: map executable negative syntax corpus rows to exact ECMA-262 requirement rows, or prove that a row duplicates already credited syntax evidence.
Until that mapping exists, those rows remain uncredited evidence, not conformance credit.