Recolor Artwork: check the row count before the randomize swatch check

The gate's test-lint step failed on the new test: its assert!(...all(...))
over the randomized map would pass on an empty map. The test now asserts
that both rows come back first.
This commit is contained in:
dotCooCoo committed 2026-12-02 15:59:38 -08:00
1 parent 7eed206ab0
commit 2c48d977f9
1 file changed
+3 -1
+3 -1
View File
@@ -928,7 +928,9 @@ fn a_rows_swatch_links_its_art_without_limit_to_library() {
assert_eq!(ink["swatch"], json!({"name": "Ink", "library": "document"}), "{r}");
assert!(green.get("swatch").is_none(), "{r}");
let r = run(&mut s, "recolor.randomize", json!({"map": two, "order": false, "saturationBrightness": true, "seed": 3}));
assert!(r["map"].as_array().unwrap().iter().all(|r| r.get("swatch").is_none()), "a changed color drops its swatch: {r}");
let rows = r["map"].as_array().unwrap();
assert_eq!(rows.len(), 2, "{r}");
assert!(rows.iter().all(|r| r.get("swatch").is_none()), "a changed color drops its swatch: {r}");
}
}