From 5f20bbc3e838aa13b07c89053ebbee53323a4233 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 2 Nov 2026 08:25:02 -0800 Subject: [PATCH] Document Info: test that a Repeat object in a selected group is listed once With Selection Only, a selection that holds a group and the Repeat object inside it, in either order, lists that Repeat object once. --- crates/engine/src/cmd/docinfo.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/docinfo.rs b/crates/engine/src/cmd/docinfo.rs index 776b4af97..0fafdf7dc 100644 --- a/crates/engine/src/cmd/docinfo.rs +++ b/crates/engine/src/cmd/docinfo.rs @@ -562,7 +562,7 @@ mod tests { /// Document Info › Repeat Objects lists each Repeat object by name with its kind and the number /// of instances it makes (for a grid, its rows and columns, followed by the number it draws when /// that is fewer), one in a group included. With Selection Only it lists the Repeat objects in - /// the selection. + /// the selection, each once when the selection holds a group and a Repeat object inside it. #[test] fn info_lists_the_repeat_objects() { let mut s = Session::new(); @@ -600,6 +600,11 @@ mod tests { }; s.execute("select.set", &json!({"ids": [grid, group]})).unwrap(); assert_eq!(names(&mut s), ["Tiles", ""]); + // A selection that holds the group and the Repeat object inside it lists that object once. + for ids in [json!([group, mirror]), json!([mirror, group])] { + s.execute("select.set", &json!({"ids": ids})).unwrap(); + assert_eq!(names(&mut s), [""], "{ids}"); + } s.execute("select.set", &json!({"ids": [radial]})).unwrap(); assert_eq!(names(&mut s), [""]); s.execute("select.set", &json!({"ids": [d]})).unwrap();