Call flush_effects in test context update()
Conrad Irwin
created
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.
Change summary
crates/gpui2/src/app/test_context.rs | 4 ++--
crates/gpui2/src/platform/test/dispatcher.rs | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
Detailed changes
@@ -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();