mirror of
https://github.com/storytold/deckcraft.git
synced 2026-11-13 21:52:59 +00:00
engine: group duplicate test compares site counts
The test compared the copy's connection sites with the original's through zip, which stops at the shorter list. It now checks that both have the same number of sites first.
This commit is contained in:
1 parent
09548fe55c
commit
2750e65096
1 file changed
+1
@@ -6559,6 +6559,7 @@ fn duplicating_a_shape_in_a_group_copies_it_into_the_group() {
|
||||
let st = s.doc().unwrap();
|
||||
let sites = |id| connect::sites_of(&st.doc, &st.selection, st.shapes(), sid(id)).unwrap();
|
||||
let (p, q) = (sites(from), sites(to));
|
||||
assert_eq!(p.len(), q.len(), "{p:?} {q:?}");
|
||||
let d = q[0] - p[0];
|
||||
assert!(p.iter().zip(&q).all(|(p, q)| (*q - *p - d).hypot() < 1e-6), "{p:?} {q:?}");
|
||||
(d.x, d.y)
|
||||
|
||||
Reference in new issue
Block a user