Cover incremental edits of route-D list units

This commit is contained in:
gloamxun committed 2026-10-20 22:08:30 +08:00
1 parent a9e5f38ef7
commit 611e6fec96
2 files changed
+28 -1

No files matched your search

+1 -1
View File
@@ -264,7 +264,7 @@ M3 (partial): `Unit::halign` normalizes column widths, intercolumn gaps, row hei
Math coverage includes fractions/roots, scripts, `\left...\right` with body-scaled delimiters, `\middle`, `\big`/`\Big`/`\bigg`/`\Bigg` and their `l`/`r` forms, control-sequence delimiters, accents (dot/check/breve/acute/grave/ring), `\text`/`\mathrm`, `\overbrace`/`\underbrace`, `\overset`/`\underset`, `\binom`, `\cancel`/`\bcancel`/`\xcancel`, `\bmod`/`\pmod`, fence symbols, `\operatorname*` and `\mathop` limits.
The crate currently has 138 unit tests plus one route-D integration test. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 230 tests (138 route-D unit, 1 route-D integration, 71 v1 integration, 15 server, 4 v1 unit, 1 doctest). v1 remains the live server path.
The crate currently has 138 unit tests plus one route-D integration test. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 231 tests (138 route-D unit, 1 route-D integration, 71 v1 integration, 16 server, 4 v1 unit, 1 doctest). v1 remains the live server path.
### M0 incremental demo
+27
View File
@@ -503,6 +503,33 @@ fn route_d_pdf_renders_itemize_content() {
assert!(response.body.len() > 500);
}
#[test]
fn edits_route_d_list_units() {
let server = TestServer::start("route-d-edit-list");
let first = server.request(
"POST",
"/api/route-d/edit/0",
b"\\begin{itemize}\\item Alpha\\item Beta\\end{itemize}",
"text/plain",
);
assert_eq!(first.status, 200, "{}", first.text());
let second = server.request(
"POST",
"/api/route-d/edit/0",
b"\\begin{itemize}\\item Gamma\\item Delta\\end{itemize}",
"text/plain",
);
assert_eq!(second.status, 200, "{}", second.text());
let value: Value = serde_json::from_slice(&second.body).expect("edit JSON");
let changed: Vec<u64> = value["changedPages"]
.as_array()
.expect("changed pages")
.iter()
.map(|page| page.as_u64().unwrap())
.collect();
assert!(changed.contains(&0), "{changed:?}");
}
#[test]
fn edits_route_d_preview_pages() {
let server = TestServer::start("route-d-edit");