mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-12 05:12:39 +00:00
Mojikumi: move the consecutive punctuation test clear of #1127's
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013phQ3ekq6uGBEWD6FjFYG2
This commit is contained in:
1 parent
aa55877b7a
commit
e06f4134d4
1 file changed
+18
-18
+18
-18
@@ -205,24 +205,6 @@ mod tests {
|
||||
use super::*;
|
||||
use crate::cjk::MojikumiTable;
|
||||
|
||||
#[test]
|
||||
fn consecutive_punctuation_touches_except_closing_before_opening() {
|
||||
let styles = Styles::default();
|
||||
for set in ["LineEndAllOneHalfEmEnum", "LineEndAllOneEmEnum", "SimpChineseDefault"] {
|
||||
let rules = Rules::resolve(&styles, set).unwrap().unwrap();
|
||||
let aki = |a: char, b: char| rules.pair(class(a), class(b)).desired;
|
||||
for (a, b) in
|
||||
[('」', '。'), ('」', '、'), ('。', '」'), ('、', '」'), ('」', '』'), (')', '」'), (',', ')'), ('「', '『'), ('(', '「')]
|
||||
{
|
||||
assert_eq!(aki(a, b), 0.0, "{set}: {a}{b}");
|
||||
}
|
||||
for (a, b) in [('」', '「'), ('。', '「'), ('、', '('), ('」', '漢'), ('漢', '「')] {
|
||||
assert_eq!(aki(a, b), 0.5, "{set}: {a}{b}");
|
||||
}
|
||||
assert_eq!(aki('」', '・'), 0.5, "{set}: the larger blank stays");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn overrides_are_directional_and_unknown_tables_are_not_silently_applied() {
|
||||
let mut styles = Styles::default();
|
||||
@@ -263,6 +245,24 @@ mod tests {
|
||||
assert_ne!(class('「'), class('('));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn consecutive_punctuation_touches_except_closing_before_opening() {
|
||||
let styles = Styles::default();
|
||||
for set in ["LineEndAllOneHalfEmEnum", "LineEndAllOneEmEnum", "SimpChineseDefault"] {
|
||||
let rules = Rules::resolve(&styles, set).unwrap().unwrap();
|
||||
let aki = |a: char, b: char| rules.pair(class(a), class(b)).desired;
|
||||
for (a, b) in
|
||||
[('」', '。'), ('」', '、'), ('。', '」'), ('、', '」'), ('」', '』'), (')', '」'), (',', ')'), ('「', '『'), ('(', '「')]
|
||||
{
|
||||
assert_eq!(aki(a, b), 0.0, "{set}: {a}{b}");
|
||||
}
|
||||
for (a, b) in [('」', '「'), ('。', '「'), ('、', '('), ('」', '漢'), ('漢', '「')] {
|
||||
assert_eq!(aki(a, b), 0.5, "{set}: {a}{b}");
|
||||
}
|
||||
assert_eq!(aki('」', '・'), 0.5, "{set}: the larger blank stays");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn one_em_line_end_set_keeps_closing_punctuation_full_at_line_end_only() {
|
||||
let styles = Styles::default();
|
||||
|
||||
Reference in new issue
Block a user