Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Represent dirty state in item-testing code
Joseph Lyons0b52308c9941
diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rsindex 31d099c04b7..a54aed96f46 100644--- a/crates/workspace/src/pane.rs+++ b/crates/workspace/src/pane.rs@@ -2429,17 +2429,17 @@ mod tests {add_labeled_item(&workspace, &pane, "A", true, cx);add_labeled_item(&workspace, &pane, "B", false, cx);- add_labeled_item(&workspace, &pane, "C", false, cx);+ add_labeled_item(&workspace, &pane, "C", true, cx);add_labeled_item(&workspace, &pane, "D", false, cx);add_labeled_item(&workspace, &pane, "E", false, cx);- assert_item_labels(&pane, ["A", "B", "C", "D", "E*"], cx);+ assert_item_labels(&pane, ["A^", "B", "C^", "D", "E*"], cx);workspace.update(cx, |workspace, cx| {Pane::close_clean_items(workspace, &CloseCleanItems, cx);});deterministic.run_until_parked();- assert_item_labels(&pane, ["A*"], cx);+ assert_item_labels(&pane, ["A^", "C*^"], cx);}#[gpui::test]@@ -2597,6 +2597,9 @@ mod tests {if ix == pane.active_item_index {state.push('*');}+ if item.is_dirty(cx) {+ state.push('^');+ }state}).collect::<Vec<_>>();