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 tests

Antonio Scandurra0a7111d21607
diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs
index a315cf0c5f1..d3d5c437c5e 100644
--- a/crates/search/src/project_search.rs
+++ b/crates/search/src/project_search.rs
@@ -949,13 +949,13 @@ impl ToolbarItemView for ProjectSearchBar {
mod tests {
use super::*;
use editor::DisplayPoint;
- use gpui::{color::Color, TestAppContext};
+ use gpui::{color::Color, executor::Deterministic, TestAppContext};
use project::FakeFs;
use serde_json::json;
use std::sync::Arc;
#[gpui::test]
- async fn test_project_search(cx: &mut TestAppContext) {
+ async fn test_project_search(deterministic: Arc<Deterministic>, cx: &mut TestAppContext) {
let fonts = cx.font_cache();
let mut theme = gpui::fonts::with_font_cache(fonts.clone(), theme::Theme::default);
theme.search.match_background = Color::red();
@@ -987,7 +987,7 @@ mod tests {
.update(cx, |query_editor, cx| query_editor.set_text("TWO", cx));
search_view.search(cx);
});
- search_view.next_notification(cx).await;
+ deterministic.run_until_parked();
search_view.update(cx, |search_view, cx| {
assert_eq!(
search_view