Fix most vim tests on linux (#12873)

Fixes most vim tests on linux (and a few editor ones) by loading Zed
Mono
instead of relying on the system fallback stack.

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-06-11 08:27:55 -06:00 committed by GitHub
parent 53b0720d54
commit a06189bbed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 18 additions and 2 deletions

1
Cargo.lock generated
View file

@ -3447,6 +3447,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"anyhow", "anyhow",
"assets",
"client", "client",
"clock", "clock",
"collections", "collections",

View file

@ -30,6 +30,7 @@ test-support = [
[dependencies] [dependencies]
aho-corasick = "1.1" aho-corasick = "1.1"
anyhow.workspace = true anyhow.workspace = true
assets.workspace = true
client.workspace = true client.workspace = true
clock.workspace = true clock.workspace = true
collections.workspace = true collections.workspace = true

View file

@ -9,7 +9,9 @@ use crate::{
JoinLines, JoinLines,
}; };
use futures::StreamExt; use futures::StreamExt;
use gpui::{div, TestAppContext, UpdateGlobal, VisualTestContext, WindowBounds, WindowOptions}; use gpui::{
div, AssetSource, TestAppContext, UpdateGlobal, VisualTestContext, WindowBounds, WindowOptions,
};
use indoc::indoc; use indoc::indoc;
use language::{ use language::{
language_settings::{ language_settings::{
@ -12184,6 +12186,12 @@ pub(crate) fn update_test_project_settings(
pub(crate) fn init_test(cx: &mut TestAppContext, f: fn(&mut AllLanguageSettingsContent)) { pub(crate) fn init_test(cx: &mut TestAppContext, f: fn(&mut AllLanguageSettingsContent)) {
_ = cx.update(|cx| { _ = cx.update(|cx| {
cx.text_system()
.add_fonts(vec![assets::Assets
.load("fonts/zed-mono/zed-mono-extended.ttf")
.unwrap()
.unwrap()])
.unwrap();
let store = SettingsStore::test(cx); let store = SettingsStore::test(cx);
cx.set_global(store); cx.set_global(store);
theme::init(theme::LoadThemes::JustBase, cx); theme::init(theme::LoadThemes::JustBase, cx);

View file

@ -10,7 +10,7 @@ use serde_json::json;
use crate::{Editor, ToPoint}; use crate::{Editor, ToPoint};
use collections::HashSet; use collections::HashSet;
use futures::Future; use futures::Future;
use gpui::{View, ViewContext, VisualTestContext}; use gpui::{AssetSource, View, ViewContext, VisualTestContext};
use indoc::indoc; use indoc::indoc;
use language::{ use language::{
point_to_lsp, FakeLspAdapter, Language, LanguageConfig, LanguageMatcher, LanguageQueries, point_to_lsp, FakeLspAdapter, Language, LanguageConfig, LanguageMatcher, LanguageQueries,
@ -39,6 +39,12 @@ impl EditorLspTestContext {
let app_state = cx.update(AppState::test); let app_state = cx.update(AppState::test);
cx.update(|cx| { cx.update(|cx| {
cx.text_system()
.add_fonts(vec![assets::Assets
.load("fonts/zed-mono/zed-mono-extended.ttf")
.unwrap()
.unwrap()])
.unwrap();
language::init(cx); language::init(cx);
crate::init(cx); crate::init(cx);
workspace::init(app_state.clone(), cx); workspace::init(app_state.clone(), cx);