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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user