mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-06 05:53:08 -05:00
Tests: check the point count before checking every point moved
CI's test-lint step failed the gate's sixth test shard: the all-unguarded rule flagged reading_and_moving_points_counts_the_subpaths_a_few_times, whose assert!(…all(…)) would also pass on a path with no anchors. The test now asserts the path still has 1000 anchors first.
This commit is contained in:
1 parent
8930d9d5dc
commit
e12e9074f1
1 file changed
+3
-1
@@ -1669,7 +1669,9 @@ fn reading_and_moving_points_counts_the_subpaths_a_few_times() {
|
||||
let built = crate::script::LAYOUTS_BUILT.with(std::cell::Cell::get);
|
||||
assert!(built < 10, "{built} layouts for 1000 points");
|
||||
let n = node(&s, id);
|
||||
assert!(n.path_data().unwrap().subpaths.iter().flat_map(|sp| &sp.anchors).all(|an| an.p.y == 9.0 || an.p.y == 19.0), "every point moved up");
|
||||
let ys: Vec<f64> = n.path_data().unwrap().subpaths.iter().flat_map(|sp| &sp.anchors).map(|an| an.p.y).collect();
|
||||
assert_eq!(ys.len(), 1000);
|
||||
assert!(ys.iter().all(|&y| y == 9.0 || y == 19.0), "every point moved up");
|
||||
}
|
||||
|
||||
/// `selectedPathPoints` lists the direct-selected anchors of a path with several subpaths in the
|
||||
|
||||
Reference in new issue
Block a user