Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix up condition not checking the condition at the start.

Piotr Osiewiczb9a917f42a93
diff --git a/crates/gpui2/src/app/test_context.rs b/crates/gpui2/src/app/test_context.rs
index c915753749f..908a418635b 100644
--- a/crates/gpui2/src/app/test_context.rs
+++ b/crates/gpui2/src/app/test_context.rs
@@ -343,12 +343,15 @@ impl TestAppContext {
use smol::future::FutureExt as _;
async {
- while notifications.next().await.is_some() {
+ loop {
if model.update(self, &mut predicate) {
return Ok(());
}
+
+ if notifications.next().await.is_none() {
+ bail!("model dropped")
+ }
}
- bail!("model dropped")
}
.race(timer.map(|_| Err(anyhow!("condition timed out"))))
.await