From 4f874088fc6621fe7dd5ca892ab379c13d59c662 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 12:13:38 -0800 Subject: [PATCH] Variables: compare the marked Data Set rows by name in the rename test egui builds the accessibility update's node list from a hash map, so the order of the open list's rows in it is not the display order. The test sorts the rows by name before checking that only Spring is marked. --- crates/ui-egui/src/panels/variables.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/panels/variables.rs b/crates/ui-egui/src/panels/variables.rs index 4005c7f48f..b85f08a9c2 100644 --- a/crates/ui-egui/src/panels/variables.rs +++ b/crates/ui-egui/src/panels/variables.rs @@ -633,8 +633,10 @@ mod tests { let text = crate::tests_labels::painted_text(&mut app, show); assert!(text.contains("Spring"), "{text}"); let rows = d.open_data_set_list(&mut app); - let marked: Vec<(Option<&str>, bool)> = rows.iter().map(|n| (n.label(), n.toggled() == Some(egui::accesskit::Toggled::True))).collect(); - assert_eq!(marked, [(Some("Spring"), true), (Some("Data Set 2"), false)]); + // The accessibility update lists nodes in hash-map order, so the rows are compared by name. + let mut marked: Vec<(Option<&str>, bool)> = rows.iter().map(|n| (n.label(), n.toggled() == Some(egui::accesskit::Toggled::True))).collect(); + marked.sort(); + assert_eq!(marked, [(Some("Data Set 2"), false), (Some("Spring"), true)]); let other = rows.iter().find(|n| n.label() == Some("Data Set 2")).expect("the Data Set 2 row").clone(); d.click(&mut app, &other); assert_eq!(app.session.active().unwrap().doc.variables.active_dataset.as_deref(), Some("Data Set 2"));