mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-05 13:32:45 -05:00
Tests: check the hatch dash row's length before its all() assertion
The gate's test-lint step flags an all() assertion with no length check in dashes_start_at_each_lines_base_point. The test now asserts the row at y 50 holds more than the four pieces it compares.
This commit is contained in:
1 parent
cc1749993d
commit
53eb048dc9
1 file changed
+1
@@ -562,6 +562,7 @@ mod tests {
|
||||
let p = pieces(&bp);
|
||||
let row = |y: f64| p.iter().filter(|(a, _)| (a.y - y).abs() < 1e-9).map(|(a, b)| (a.x, b.x)).collect::<Vec<_>>();
|
||||
let first = row(50.0);
|
||||
assert!(first.len() > 4, "{first:?}");
|
||||
// The pattern at y 50 starts at x 5, so the period before it puts a dot on the boundary.
|
||||
assert_eq!(&first[..4], &[(0.0, 0.0), (5.0, 8.0), (10.0, 10.0), (15.0, 18.0)]);
|
||||
assert!(first.iter().all(|(a, b)| *a >= 0.0 && *b <= 100.0));
|
||||
|
||||
Reference in new issue
Block a user