Remove unused dependencies and avoid instantiating FontCache in tests
This commit is contained in:
@@ -1907,7 +1907,7 @@ mod tests {
|
||||
use gpui::App;
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
|
||||
let mut app = App::test((), |mut app| async move {
|
||||
App::test((), |mut app| async move {
|
||||
let buffer_1_events = Rc::new(RefCell::new(Vec::new()));
|
||||
let buffer_2_events = Rc::new(RefCell::new(Vec::new()));
|
||||
|
||||
|
||||
@@ -996,7 +996,6 @@ impl BufferView {
|
||||
.each(
|
||||
layouts.chunks_mut(chunk_size as usize).enumerate(),
|
||||
|(ix, chunk)| {
|
||||
let font_cache = &font_cache;
|
||||
let chunk_start = rows.start as usize + ix * chunk_size;
|
||||
let chunk_end = cmp::min(chunk_start + chunk_size, rows.end as usize);
|
||||
|
||||
@@ -1363,11 +1362,9 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_layout_line_numbers() -> Result<()> {
|
||||
use gpui::{fonts::FontCache, text_layout::TextLayoutCache};
|
||||
|
||||
App::test((), |mut app| async move {
|
||||
let font_cache = FontCache::new(app.platform().fonts());
|
||||
let layout_cache = TextLayoutCache::new(app.platform().fonts());
|
||||
let font_cache = app.font_cache();
|
||||
|
||||
let buffer = app.add_model(|_| Buffer::new(0, sample_text(6, 6)));
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ fn open_paths(params: &OpenParams, app: &mut MutableAppContext) {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{settings, test::*};
|
||||
use gpui::{App, FontCache};
|
||||
use gpui::App;
|
||||
use serde_json::json;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -325,7 +325,7 @@ mod tests {
|
||||
use super::{pane, Workspace, WorkspaceView};
|
||||
use crate::{settings, test::temp_tree, workspace::WorkspaceHandle as _};
|
||||
use anyhow::Result;
|
||||
use gpui::{App, FontCache};
|
||||
use gpui::App;
|
||||
use serde_json::json;
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user