From 9ea392e6ee87f10f695047182c5acec99e6bf8bb Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 9 Oct 2026 20:11:40 -0700 Subject: [PATCH] Tests: the command sweeps no longer skip junk scale, spacing and artboard values The sweeps `every_command_with_junk_params` and `fuzzed_calls_keep_documents_serializable` skipped every case that set `object.scale`'s `sx`, `object.transformEach`'s `scaleH` or `scaleV`, `object.distributeSpacing`'s `spacing`, or `artboard.setProps`'s `x`, `y`, `width` or `height`. The comment above `KNOWN_BUGS`, the list of those (command, param) pairs, referred to `#[ignore]`d repro tests, but `bug_huge_transform_makes_document_unloadable` and `bug_artboard_huge_props_break_svg` have no `#[ignore]` and run with the other tests. Since 42df20ca, the commit that added the list, `Session::edit` returns an error when an edit leaves an artboard or a selected object with coordinates that are not finite or exceed `MAX_COORD`, and `object.transformEach` clamps `scaleH` and `scaleV`. The list and its two checks are removed, so both sweeps run those cases. --- crates/engine/tests/command_sweep.rs | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/crates/engine/tests/command_sweep.rs b/crates/engine/tests/command_sweep.rs index d603ca88..c383051f 100644 --- a/crates/engine/tests/command_sweep.rs +++ b/crates/engine/tests/command_sweep.rs @@ -81,23 +81,6 @@ fn every_command_without_a_document() { assert!(failures.is_empty(), "{}", failures.join("\n")); } -/// Known bugs (see the `#[ignore]` repro tests below): (command, param key) pairs skipped by the -/// junk sweep so the rest of the sweep stays meaningful. -const KNOWN_BUGS: &[(&str, &str)] = &[ - ("object.scale", "sx"), - ("object.transformEach", "scaleH"), - ("object.transformEach", "scaleV"), - ("object.distributeSpacing", "spacing"), - ("artboard.setProps", "x"), - ("artboard.setProps", "y"), - ("artboard.setProps", "width"), - ("artboard.setProps", "height"), -]; - -fn known_bug(id: &str, p: &Value) -> bool { - KNOWN_BUGS.iter().any(|(c, k)| *c == id && p.get(*k).is_some()) -} - /// Regression: huge column counts used to panic with `capacity overflow`; in every layout and /// order (#681), with huge and negative spacing too. #[test] @@ -157,9 +140,6 @@ fn every_command_with_junk_params() { cases.truncate(12); } for p in &cases { - if known_bug(c.id, p) { - continue; - } calls += 1; if let Some(f) = probe(fx, c.id, p) { failures.push(f); @@ -494,9 +474,6 @@ fn fuzzed_calls_keep_documents_serializable() { let k = if k == "path" { continue } else { k }; let mut s = Fixture::Multi.session(); let p = json!({ k.clone(): v }); - if known_bug(c.id, &p) { - continue; - } let ok = catch_quiet(|| s.execute(c.id, &p)).map(|r| r.is_ok()).unwrap_or(false); if ok && let Err(e) = catch_quiet(|| check_all(&mut s)).unwrap_or_else(|m| Err(format!("panic in checks: {m}"))) { failures.push(format!("{} {p}: {e}", c.id));