Skip to content

Commit 31efc67

Browse files
test(text): the bullet is the ❑ or the dot the face draws, by glyph
1 parent 9d32bc4 commit 31efc67

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎crates/text/src/tests.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ fn bullet_in_an_unavailable_unicode_symbol_font_keeps_its_character() {
192192
let l = lay(&p, &sh, 600.0, 300.0);
193193
let bullet = l.runs.iter().find(|r| r.chars == (0, 0)).expect("bullet run");
194194
assert_eq!(bullet.glyphs.len(), 1);
195-
assert_ne!(bullet.glyphs[0].0, 0, "the bullet is drawn, not .notdef");
195+
// The bullet's face draws ❑ if it has it, else the dot: never .notdef, never another glyph.
196+
let drawn = bullet.glyphs[0].0;
197+
let square = deckcraft_fonts::first_glyph(&bullet.face, &['\u{2751}']);
198+
let dot = deckcraft_fonts::first_glyph(&bullet.face, &['\u{2022}']);
199+
assert!(drawn != 0 && (drawn == square || drawn == dot), "drawn glyph {drawn}, ❑ {square}, • {dot}");
196200
}
197201

198202
#[test]

0 commit comments

Comments
 (0)