From 96ca33b0ef729a5030fc85caa9802d487e217d4d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 4 Nov 2026 23:05:09 -0800 Subject: [PATCH] Tests: the Devanagari fallback-glyph test passes when the fallback face substitutes the vowel sign `the_fallback_glyph_of_a_consonant_after_its_vowel_sign_is_reported` expected the fallback face's cmap glyph for the vowel sign I. On the Ubuntu runner the fallback face is Noto Sans Devanagari, whose shaping draws the sign with another glyph (545 instead of 32), so the test failed on `main`. It now checks that two glyphs are drawn in Ka's cluster, the first is not Ka's and the second is, and keeps the `text.glyphAlternates` checks. Fixes #5750 --- crates/engine/src/tests/textedit.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/tests/textedit.rs b/crates/engine/src/tests/textedit.rs index 9f607d78a..b2694ffcc 100644 --- a/crates/engine/src/tests/textedit.rs +++ b/crates/engine/src/tests/textedit.rs @@ -2823,9 +2823,11 @@ fn the_fallback_glyph_of_a_consonant_after_its_vowel_sign_is_reported() { let glyphs = vectorcraft_text::layout(db, &obj(&s, open)).glyphs; let fallback = db.face_by_id(glyphs[0].font_id).expect("the fallback face"); assert_ne!(fallback.id(), requested.id()); - let (ka, sign) = (fallback.glyph_for('क'), fallback.glyph_for('\u{93F}')); + let ka = fallback.glyph_for('क'); let drawn: Vec<_> = glyphs.iter().map(|g| (g.gid, g.byte)).collect(); - assert_eq!(drawn, [(sign, 0), (ka, 0)], "the vowel sign is drawn first, in Ka's cluster ({} or {MATRA_FAMILY})", fallback.family); + // A face may draw the vowel sign with a glyph other than its own, so only its place is checked. + let sign_first = matches!(drawn[..], [(sign, 0), (k, 0)] if sign != 0 && sign != ka && k == ka); + assert!(sign_first, "the vowel sign is drawn first, in Ka's cluster ({} or {MATRA_FAMILY}): {drawn:?}", fallback.family); let query = s.execute("text.glyphAlternates", &json!({"id": open.0, "start": 0})).unwrap(); assert_eq!(query["chosen"], json!(ka), "the fallback face's glyph for Ka");