From baf6e1b85e07fca0168962dbc8993fd033bedda2 Mon Sep 17 00:00:00 2001 From: aiongg Date: Sat, 31 Oct 2026 01:02:16 +0000 Subject: [PATCH] Integration: #1676 the Insert Table limits test uses the limits, not sizes above them Main refuses a size outside the limits instead of clamping it, so the test inserts the largest table and checks one step over each limit is refused. --- crates/engine/src/tests/table.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/tests/table.rs b/crates/engine/src/tests/table.rs index c31a63dd4..77bcb9bfd 100644 --- a/crates/engine/src/tests/table.rs +++ b/crates/engine/src/tests/table.rs @@ -503,7 +503,10 @@ fn insert_table_with_a_style_is_one_step() { assert!(s.execute("table.insert", &json!({"tableStyle": bad})).is_err(), "{bad}"); } assert!(s.doc().unwrap().doc.story(designcraft_doc::StoryId(sid)).unwrap().tables.is_empty()); - let r = s.execute("table.insert", &json!({"rows": 900, "cols": 300, "headerRows": 150, "tableStyle": "Grid"})).unwrap(); + for over in [json!({"rows": 501}), json!({"cols": 201}), json!({"headerRows": 101})] { + assert!(s.execute("table.insert", &over).is_err(), "{over}"); + } + let r = s.execute("table.insert", &json!({"rows": 500, "cols": 200, "headerRows": 100, "tableStyle": "Grid"})).unwrap(); let t = s.execute("table.get", &json!({"table": r["table"]})).unwrap(); assert_eq!(t["style"], "Grid"); let n = |k: &str| t[k].as_array().unwrap().len() as u64;