Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Call flush_effects in test context update()
Conrad Irwinb8e007c6ec4c
diff --git a/crates/gpui2/src/app/test_context.rs b/crates/gpui2/src/app/test_context.rsindex 16d7504b2da..f590d05c6c9 100644--- a/crates/gpui2/src/app/test_context.rs+++ b/crates/gpui2/src/app/test_context.rs@@ -64,8 +64,8 @@ impl TestAppContext {}pub fn update<R>(&self, f: impl FnOnce(&mut AppContext) -> R) -> R {- let mut lock = self.app.lock();- f(&mut *lock)+ let mut cx = self.app.lock();+ cx.update(f)}pub fn read_window<R>(diff --git a/crates/gpui2/src/platform/test/dispatcher.rs b/crates/gpui2/src/platform/test/dispatcher.rsindex 7c4af964b08..db70e7e4c13 100644--- a/crates/gpui2/src/platform/test/dispatcher.rs+++ b/crates/gpui2/src/platform/test/dispatcher.rs@@ -77,7 +77,6 @@ impl TestDispatcher {type Output = ();fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {- eprintln!("self.count: {}", self.count);if self.count > 0 {self.count -= 1;cx.waker().wake_by_ref();