Merge branch 'main' into rpc

This commit is contained in:
Antonio Scandurra
2021-06-29 10:25:42 +02:00
18 changed files with 531 additions and 282 deletions
+13 -7
View File
@@ -311,17 +311,24 @@ impl FontSystemState {
#[cfg(test)]
mod tests {
use crate::MutableAppContext;
use super::*;
use font_kit::properties::{Style, Weight};
use platform::FontSystem as _;
#[test]
fn test_layout_str() -> anyhow::Result<()> {
#[crate::test(self, retries = 5)]
fn test_layout_str(_: &mut MutableAppContext) {
// This is failing intermittently on CI and we don't have time to figure it out
let fonts = FontSystem::new();
let menlo = fonts.load_family("Menlo")?;
let menlo_regular = fonts.select_font(&menlo, &Properties::new())?;
let menlo_italic = fonts.select_font(&menlo, &Properties::new().style(Style::Italic))?;
let menlo_bold = fonts.select_font(&menlo, &Properties::new().weight(Weight::BOLD))?;
let menlo = fonts.load_family("Menlo").unwrap();
let menlo_regular = fonts.select_font(&menlo, &Properties::new()).unwrap();
let menlo_italic = fonts
.select_font(&menlo, &Properties::new().style(Style::Italic))
.unwrap();
let menlo_bold = fonts
.select_font(&menlo, &Properties::new().weight(Weight::BOLD))
.unwrap();
assert_ne!(menlo_regular, menlo_italic);
assert_ne!(menlo_regular, menlo_bold);
assert_ne!(menlo_italic, menlo_bold);
@@ -342,7 +349,6 @@ mod tests {
assert_eq!(line.runs[1].glyphs.len(), 4);
assert_eq!(line.runs[2].font_id, menlo_regular);
assert_eq!(line.runs[2].glyphs.len(), 5);
Ok(())
}
#[test]