From 92d0ffdc62828a02dadacc6bd0817af436a806df Mon Sep 17 00:00:00 2001 From: Zinadin Zidan Date: Sat, 14 Nov 2026 04:31:08 +0600 Subject: [PATCH] Variables: fix the move order in the group rename collision test (#2353) Both moves had names of the same length, so which one ran first came from the order of the variables. The first one now has a longer name, which the longest-first order always moves first, so the second one always collides after a move that has to be undone. --- crates/ui-egui/src/variables_select_tests.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/variables_select_tests.rs b/crates/ui-egui/src/variables_select_tests.rs index 2d5bd3342..bcc41463d 100644 --- a/crates/ui-egui/src/variables_select_tests.rs +++ b/crates/ui-egui/src/variables_select_tests.rs @@ -405,11 +405,12 @@ fn renaming_a_group_into_its_own_new_subgroup_moves_the_deeper_names_first() { #[test] fn a_group_rename_onto_a_variable_name_that_stays_changes_nothing() { - // Orange/100 moves first; Orange/200 then collides, and the move already made is undone. - let mut u = named_window(&["Orange/100", "Orange/200", "Palette/Orange/200"]); + // The longer name moves first, whatever the order of the variables: Orange/1000 moves, then + // Orange/200 collides, and the move already made is undone. + let mut u = named_window(&["Orange/1000", "Orange/200", "Palette/Orange/200"]); rename_group(&mut u, "Orange", "Palette/Orange"); assert!(u.app.ui.last_error.as_deref().is_some_and(|e| e.contains("Palette/Orange/200")), "{:?}", u.app.ui.last_error); - assert_eq!(sorted_names(&u), ["Orange/100", "Orange/200", "Palette/Orange/200"]); + assert_eq!(sorted_names(&u), ["Orange/1000", "Orange/200", "Palette/Orange/200"]); } fn open_edit_variables(u: &mut Ui) -> Vec {