diff --git a/src/endor_host.rs b/src/endor_host.rs index 1278339..b62f41b 100644 --- a/src/endor_host.rs +++ b/src/endor_host.rs @@ -2963,6 +2963,57 @@ page.render(block) .unwrap() } + #[test] + fn shared_intrinsic_desktop_does_not_repaint_other_windows_on_repl_input() { + let (mut session, _) = ReplSession::load( + r##" +class Painted: RectBlock { + tint: String + function paint(self: Painted, mount: Mount, geometry: Bounds): DisplayList { + drawing = RectBlock.paint(self,mount,geometry) + drawing.commands.at(0).color = self.tint + return drawing + } +} +item = Painted(80,20,0,"#DDEEFF","#ED6A5A") +page = Page() +page.render(item) +window2 = Window() +page2 = Page() +page2.render(item) +page2.moveToWindow(window2) +"##, + "app.main", + 901, + 1, + ) + .unwrap(); + assert!( + session + .execute("42", "app.main") + .unwrap() + .document + .is_none() + ); + let changed = session + .execute("item.tint = \"#3868D9\"", "app.main") + .unwrap() + .document + .unwrap(); + assert!(changed.frame.commands.iter().any(|command| matches!( + command, RenderCommand::RoundedRect { color, .. } if color == "#3868D9" + ))); + assert!( + changed.windows[&2] + .frame + .commands + .iter() + .any(|command| matches!( + command, RenderCommand::RoundedRect { color, .. } if color == "#3868D9" + )) + ); + } + #[test] fn source_measure_cache_reuses_independent_results_and_invalidates_model_changes() { let (mut session, initial) = ReplSession::load_with_viewport(