From a6ec09afb223fd65ece2dcb4ea3a3f02c079be88 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 14 Oct 2026 01:41:17 +0000 Subject: [PATCH] Integration: #643's test (an empty Effects field path sets nothing) --- crates/ui-egui/src/effects_dialog.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/ui-egui/src/effects_dialog.rs b/crates/ui-egui/src/effects_dialog.rs index 0036a37f6..4bdba85f2 100644 --- a/crates/ui-egui/src/effects_dialog.rs +++ b/crates/ui-egui/src/effects_dialog.rs @@ -657,6 +657,16 @@ mod tests { texts } + #[test] + fn set_makes_the_path_and_ignores_an_empty_one() { + let mut d = Dialog::new(ID, json!({"fx": {}})); + set(&mut d, &["featherOptions", "choke"], json!(20)); + assert_eq!(d.fields["fx"]["featherOptions"]["choke"], json!(20)); + let before = d.fields.clone(); + set(&mut d, &[], json!(1)); + assert_eq!(d.fields, before, "an empty path changes nothing (and doesn't panic)"); + } + #[test] fn the_effects_dialog_opens_on_the_chosen_effect_previews_and_applies_once() { let (mut app, id) = app_with_frame();