From 38945668129cfae5d26774cbfb4abbaa8c3ffa27 Mon Sep 17 00:00:00 2001 From: con3code Date: Wed, 4 Nov 2026 08:52:41 +0900 Subject: [PATCH] Mojikumi: test consecutive punctuation under the one-em line-end set too The close-up test checked the half-em line-end set only; the other Japanese base set closes up the same pairs. Co-Authored-By: Claude Opus 5.5 --- crates/compose/src/tests.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/compose/src/tests.rs b/crates/compose/src/tests.rs index db03b67d8..d7d9b6535 100644 --- a/crates/compose/src/tests.rs +++ b/crates/compose/src/tests.rs @@ -6170,7 +6170,8 @@ fn mojikumi_one_em_line_end_set_sets_closing_punctuation_full_width_at_line_end( } /// Consecutive punctuation touches (JLREQ 3.1.4): in 漢」。漢(「漢 the closing bracket and -/// the full stop, and the two opening brackets, close up by half an em each. +/// the full stop, and the two opening brackets, close up by half an em each, under both +/// Japanese base sets (the full stop isn't at the line end, so the line-end rule doesn't apply). #[test] fn mojikumi_closes_up_consecutive_punctuation() { let family = "Mojikumi Consecutive"; @@ -6187,8 +6188,10 @@ fn mojikumi_closes_up_consecutive_punctuation() { (line.end_x - line.x0, g.face.units_per_em() * g.sx) }; let (natural, em) = width("Nothing"); - let (set, _) = width("LineEndAllOneHalfEmEnum"); - assert!((natural - set - em).abs() < 0.01, "{natural} - {set} should be one em ({em})"); + for name in ["LineEndAllOneHalfEmEnum", "LineEndAllOneEmEnum"] { + let (set, _) = width(name); + assert!((natural - set - em).abs() < 0.01, "{name}: {natural} - {set} should be one em ({em})"); + } } fn ruled(text: &str, rect: Rect, columns: u32, edit: impl FnOnce(&mut Document, StoryId)) -> (Document, ItemId, Vec) {