windows: Fix tests on Windows (#22616)

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla.c.maki@gmail.com>
This commit is contained in:
张小白
2025-02-05 14:30:09 +00:00
committed by GitHub
co-authored by Mikayla
parent c252b5db16
commit 74c4dbd237
56 changed files with 1540 additions and 856 deletions
+16
View File
@@ -12,6 +12,7 @@ pub fn test_settings() -> String {
crate::default_settings().as_ref(),
)
.unwrap();
#[cfg(not(target_os = "windows"))]
util::merge_non_null_json_value_into(
serde_json::json!({
"ui_font_family": "Courier",
@@ -26,6 +27,21 @@ pub fn test_settings() -> String {
}),
&mut value,
);
#[cfg(target_os = "windows")]
util::merge_non_null_json_value_into(
serde_json::json!({
"ui_font_family": "Courier New",
"ui_font_features": {},
"ui_font_size": 14,
"ui_font_fallback": [],
"buffer_font_family": "Courier New",
"buffer_font_features": {},
"buffer_font_size": 14,
"buffer_font_fallback": [],
"theme": EMPTY_THEME_NAME,
}),
&mut value,
);
value.as_object_mut().unwrap().remove("languages");
serde_json::to_string(&value).unwrap()
}