Call flush_effects in test context update()

In gpui1 we used to do this even outside of top-level contexts, but not
sure we should make tests work that differently to the main app.
This commit is contained in:
Conrad Irwin
2023-10-31 14:24:12 +00:00
parent 3e5379526e
commit b8e007c6ec
2 changed files with 2 additions and 3 deletions
+2 -2
View File
@@ -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>(
@@ -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();