mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-25 20:14:31 +01:00
The OMML writer (omml/write.rs) had no tests of its own, and the linear-format parser (math_linear.rs) none in its own module. - omml/write/tests.rs: every MNode variant and option, run properties, the three sources write_equation takes an equation from (kept OMML, nodes, linear text), the equation colour (#1467), display jc, resolve_numbers, m:mathPr and the matrix and depth caps (#4000) are written and read back with read_omath. What the reader gives back differently on purpose (merged runs, half-point sizes, matrix column alignments, an empty delimiter...) is stated as such. Element order, which a round trip can't see, is pinned by exact XML: each structure with its defaults and with every property on, a run, m:oMathPara and m:mathPr. The strings follow the ECMA-376 shared-math sequences. - math_linear/tests.rs: one case per construct of the module doc, the helpers (closer, is_combining, strip_parens), to_linear round trips and truncated input. Where Word builds the same text, the expected tree is Word's. Tests only; no behaviour change. Ported from storytold/wordcraft#6080 (issue wordcraft#6079), on top of the other ports in this series, which they pass with unchanged. The writer tests move from WordCraft's docx/src/write/math/tests.rs to omml/write/tests.rs, with craft-math's paths for what they used from WordCraft (read_omath, para_jc and read_math_pr from omml, each_run_mut from math_tree, map_args from math_linear), and OMML read back with omml::parse instead of WordCraft's xml::parse_strict over namespace-wrapped text.