Skip to content

Commit

Permalink
Fixes #334 which missed added the double-struck typeface in a list.
Browse files Browse the repository at this point in the history
Added a test for it and turned on the "other.rs" tests which for some reason wasn't in braille.rs.
  • Loading branch information
NSoiffer committed Jan 18, 2025
1 parent a200377 commit 6af188f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/braille.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ fn nemeth_cleanup(raw_braille: String) -> String {
Regex::new(r"(⠈⠠⠎|⠈⠠⠏|⠨⠼|⠈⠼)N").unwrap();

// Needed after a typeface change or interior shape modifier indicator
static ref NUM_IND_9E: Regex = Regex::new(r"(?P<face>[SBTIR]+?)N").unwrap();
static ref NUM_IND_9E: Regex = Regex::new(r"(?P<face>[SB𝔹TIR]+?)N").unwrap();
static ref NUM_IND_9E_SHAPE: Regex = Regex::new(r"(?P<mod>⠸⠫)N").unwrap();

// Needed after hyphen that follows a word, abbreviation, or punctuation (caution about rule 11d)
Expand Down
1 change: 1 addition & 0 deletions tests/braille.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod common;
mod braille {
mod Nemeth {
mod rules;
mod other;
mod chemistry;
mod SRE_Nemeth72;
mod SRE_NemethBase;
Expand Down
15 changes: 7 additions & 8 deletions tests/braille/Nemeth/other.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,17 @@ fn space_hack_between_digits() {
test_braille("Nemeth", expr, "⠼⠂⠀⠼⠒⠀⠼⠢");
}

#[test]
fn space_hack_around_operator() {
// https://github.com/NSoiffer/MathCAT/issues/144
let expr = "<math><mi>y</mi><mtext>&#x00a0;&#x2063;</mtext><mo>=</mo><mtext>&#x00a0;&#x2063;</mtext><mn>5</mn></math>";
test_braille("Nemeth", expr, "⠽⠀⠨⠅⠀⠼⠢");
}


#[test]
fn tilde_prefix_bug_244() {
// https://github.com/NSoiffer/MathCAT/issues/244
let expr = "<math> <mo>~</mo> <mi>p</mi> </math>";
test_braille("Nemeth", expr, "⠈⠱⠏");
}

#[test]
fn double_struck_bug_334() {
// https://github.com/NSoiffer/MathCAT/issues/334 -- double struck was problem (⠼ was missing); test all of the scripted numbers here
let expr = "<math><mn>𝟙</mn><mo>,</mo><mn>𝟐</mn><mo>,</mo><mn>𝟯</mn><mo>,</mo><mn>𝟺</mn></math>";
test_braille("Nemeth", expr, "⠈⠼⠂⠠⠀⠸⠼⠆⠠⠀⠈⠰⠸⠼⠒⠠⠀⠼⠲");
}

0 comments on commit 6af188f

Please sign in to comment.