diff --git a/.gitignore b/.gitignore index b4a54ec2c..fef5d915c 100644 --- a/.gitignore +++ b/.gitignore @@ -57,5 +57,3 @@ Rules/*/*/*.zip docs/_site docs/.jekyll-cache docs/Gemfile.lock - -docs/nb_of_norway/ \ No newline at end of file diff --git a/Rules/Languages/en/SharedRules/default.yaml b/Rules/Languages/en/SharedRules/default.yaml index 21cfc256b..c1f07ec7d 100644 --- a/Rules/Languages/en/SharedRules/default.yaml +++ b/Rules/Languages/en/SharedRules/default.yaml @@ -62,7 +62,7 @@ - test: - if: "string-length(.) = 1 and text() != '_'" # need unicode.tdl to kick in for single letter tokens then: [x: "text()"] - - else_if: "@data-chem-element > 0 or @data-roman-numeral" # NavMode=Character needs this + - else_if: "@data-chem-element or @data-roman-numeral" # NavMode=Character needs this then: [spell: "text()", pause: "short"] else: [x: "translate(., '-_\u00A0', ' ')"] # from intent literals or from extra spaces added (which get deleted) @@ -237,26 +237,12 @@ - x: "*[2]" - t: "below" # phrase(x with z 'below' it) -# FIX: this only works for up to four dots (which is realistically all we need) -- name: dot-over - tag: modified-variable - match: "*[1][self::m:mi] and (*[2][translate(., '.', '')=''])" - replace: - - x: "*[1]" - - x: "IfThenElse(string-length(*[2])=1, 'dot', - IfThenElse(string-length(*[2])=2, 'double dot', - IfThenElse(string-length(*[2])=3, 'triple dot', 'quadruple dot') - ))" - - pause: short - -# FIX: the 'translate' list is a little different from 'modified-variable', so we also include 'mover' (unify?) - name: diacriticals - tag: [mover, modified-variable] + tag: mover match: "*[1][self::m:mi] and *[2][translate(., '\u0306\u030c.\u00A8\u02D9\u20DB\u20DC`^ˇ~→¯_', '')='']" replace: - x: "*[1]" - x: "*[2]" - - pause: short - name: default tag: mover @@ -436,23 +422,22 @@ - t: "end scripts" # phrase(At this point 'end scripts' occurs) - name: default - tag: [mtable, array] + tag: mtable variables: - IsColumnSilent: "false()" - - NumColumns: "CountTableColumns(.)" - - NumRows: "CountTableRows(.)" + - NumColumns: "count(*[1]/*) - IfThenElse(*/self::m:mlabeledtr, 1, 0)" match: "." replace: - t: "table with" # phrase(the 'table with' 3 rows) - - x: "$NumRows" + - x: count(*) - test: - if: "$NumRows=1" + if: count(*)=1 then: [t: "row"] # phrase(the table with 1 'row') else: [t: "rows"] # phrase(the table with 3 'rows') - t: "and" # phrase(the table with 3 rows 'and' 4 columns) - x: "$NumColumns" - test: - if: "$NumColumns=1" + if: "NumColumns=1" then: [t: "column"] # phrase(the table with 3 rows and 1 'column') else: [t: "columns"] # phrase(the table with 3 rows and 4 'columns') - pause: long diff --git a/build.rs b/build.rs index ba3296ce0..a48b26033 100644 --- a/build.rs +++ b/build.rs @@ -151,6 +151,9 @@ fn zip_entry( /// Zip up each language and braille dir /// Note: regional variations (including zh-cn and zh-tw) are zipped together into one zip file fn main() { + println!("cargo::rerun-if-changed=build.rs"); + println!("cargo::rerun-if-changed=Rules"); + // This doesn't work because the build claims OUT_DIR is not defined(?) // let archive = PathBuf::from(concat!(env!("OUT_DIR"),"/rules.zip")); if std::env::var("CARGO_FEATURE_INCLUDE_ZIP").is_ok() { @@ -198,6 +201,5 @@ fn main() { if let Err(e) = archive_zip.finish() { panic!("Error in zip.finish(): {}", e); } - println!("cargo::rerun-if-changed=Rules"); } } diff --git a/src/braille.rs b/src/braille.rs index 9aa7a92a3..8a8f7dc88 100644 --- a/src/braille.rs +++ b/src/braille.rs @@ -446,13 +446,12 @@ pub fn get_navigation_node_from_braille_position(mathml: Element, position: usiz /// find the navigation node that most tightly encapsulates the target position (0-based) /// 'node' is the current node we are on inside of 'mathml' fn find_navigation_node<'e>(mathml: Element<'e>, node: Element<'e>, target_position: usize) -> Result> { - let raw_node_id = node.attribute_value("id"); - let node_id = match raw_node_id.as_deref() { + let node_id = match node.attribute_value("id") { Some(id) => id, None => bail!("'id' is not present on mathml: {}", mml_to_string(node)), }; N_PROBES.with(|n| {*n.borrow_mut() += 1}); - let (braille, char_start, char_end) = braille_mathml(mathml, node_id)?; + let (braille, char_start, char_end) = braille_mathml(mathml, as_str!(node_id))?; let mut status = None; // debug!("find_navigation_node ({}, id={}): highlight=[{}, {}); target={}", name(node), node_id, char_start, char_end, target_position); if is_leaf(node) { @@ -519,7 +518,7 @@ pub fn get_navigation_node_from_braille_position(mathml: Element, position: usiz return Ok(status); }, SearchStatus::LookInParent => { - let (_, start, end) = braille_mathml(mathml, node_id)?; + let (_, start, end) = braille_mathml(mathml, as_str!(node_id))?; // debug!(" parent ({}) braille: start/end={}/{}; target_position={}", name(node), start, end, target_position); if start <= target_position && target_position < end { // debug!(" ..found: id={}", node_id); @@ -2633,7 +2632,7 @@ impl BrailleChars { // also true (sort of) for capitalization -- if all caps, use double cap in front (assume abbr or Roman Numeral) // we only care about this for numbers and identifiers/text, so we filter for only those - let node_name = name(node); + let node_name = as_str!(name(node)); let is_in_enclosed_list = node_name != "mo" && BrailleChars::is_in_enclosed_list(node); let is_mn_in_enclosed_list = is_in_enclosed_list && node_name == "mn"; let mut typeface = "R".to_string(); // assumption is "R" and if attr or letter is different, something happens @@ -2917,8 +2916,8 @@ impl BrailleChars { "mo" => !crate::canonicalize::is_relational_op(node), "mtext" => { let raw_text = as_text(node); - let text = raw_text.trim(); - return text=="?" || text=="-?-" || text.is_empty(); + let text = as_str!(raw_text).trim(); + return text=="?" || text=="-?-" || text.is_empty(); // various forms of "fill in missing content" (see also Nemeth_RULEs.yaml, "omissions") }, "mrow" => { if IsBracketed::is_bracketed(node, "", "", false, false) { @@ -2933,7 +2932,7 @@ impl BrailleChars { true }, "menclose" => { - if let Some(notation) = node.attribute_value("notation").as_deref() { + if let Some(notation) = node.attribute_value("notation") { if notation != "bottom" || notation != "box" { return false; } @@ -3021,7 +3020,7 @@ impl NeedsToBeGrouped { // ordinals often have an irregular start (e.g., "half") before becoming regular. // if the number is irregular, return the ordinal form, otherwise return 'None'. fn needs_grouping_for_cmu(element: Element, _is_base: bool) -> bool { - let node_name = name(element); + let node_name = as_str!(name(element)); let children = element.children(); if node_name == "mrow" { // check for bracketed exprs @@ -3076,10 +3075,11 @@ impl NeedsToBeGrouped { /// FIX: what needs to be implemented? fn needs_grouping_for_finnish(mathml: Element, is_base: bool) -> bool { use crate::xpath_functions::IsInDefinition; - let mut node_name = as_str!(name(mathml)); - if mathml.attribute_value("data-roman-numeral").is_some() { - node_name = "mi"; // roman numerals don't follow number rules - } + let node_name = if mathml.attribute_value("data-roman-numeral").is_some() { + "mi" // roman numerals don't follow number rules + } else { + as_str!(name(mathml)) + }; // FIX: the leaf rules are from UEB -- check the Swedish rules match node_name { @@ -3167,10 +3167,11 @@ impl NeedsToBeGrouped { // if the number is irregular, return the ordinal form, otherwise return 'None'. fn needs_grouping_for_swedish(mathml: Element, is_base: bool) -> bool { use crate::xpath_functions::IsInDefinition; - let mut node_name = as_str!(name(mathml)); - if mathml.attribute_value("data-roman-numeral").is_some() { - node_name = "mi"; // roman numerals don't follow number rules - } + let node_name = if mathml.attribute_value("data-roman-numeral").is_some() { + "mi" // roman numerals don't follow number rules + } else { + as_str!(name(mathml)) + }; match node_name { "mn" => return false, @@ -3234,10 +3235,11 @@ impl NeedsToBeGrouped { // 8. If none of the foregoing apply, the item is simply the [this element's] individual symbol. use crate::xpath_functions::IsInDefinition; - let mut node_name = as_str!(name(mathml)); - if mathml.attribute_value("data-roman-numeral").is_some() { - node_name = "mi"; // roman numerals don't follow number rules - } + let node_name = if mathml.attribute_value("data-roman-numeral").is_some() { + "mi" // roman numerals don't follow number rules + } else { + as_str!(name(mathml)) + }; match node_name { "mn" => { if !is_base { diff --git a/src/canonicalize.rs b/src/canonicalize.rs index eaf8f1fa9..a93ce3b44 100644 --- a/src/canonicalize.rs +++ b/src/canonicalize.rs @@ -5535,7 +5535,6 @@ mod canonicalize_tests { } #[test] - #[ignore] // need to figure out a test for this ("|" should have a precedence around ":" since that is an alternative notation for "such that", but "∣" is higher precedence) fn vertical_bar_divides() -> Result<()> { let test_str = " x+y |12 @@ -5547,7 +5546,7 @@ mod canonicalize_tests { + y - + | 12 "; @@ -6896,7 +6895,6 @@ mod canonicalize_tests { #[test] - #[ignore] // this fails -- need to figure out grabbing base from previous or next child fn tensor() -> Result<()> { let test_str = " Ri @@ -6913,7 +6911,7 @@ mod canonicalize_tests { j k - l + l "; diff --git a/src/chemistry.rs b/src/chemistry.rs index b8a6ca4fc..f76208b76 100644 --- a/src/chemistry.rs +++ b/src/chemistry.rs @@ -2143,7 +2143,6 @@ mod chem_tests { } #[test] - #[ignore] // It would be good to say "not chemistry" for this, but there aren't rules for that at the moment fn test_water_bond() -> Result<()> { return chem_test(|| { let test11 = r#"H2O=O"#; diff --git a/src/interface.rs b/src/interface.rs index 93a84c389..e443c9882 100644 --- a/src/interface.rs +++ b/src/interface.rs @@ -1365,11 +1365,11 @@ mod tests { set_mathml(good_mathml)?; let bad_mathml = "&xabc;"; assert!(set_mathml(bad_mathml).is_err()); - assert!(get_spoken_text()? == ""); + assert!(get_spoken_text()?.is_empty()); set_mathml(good_mathml)?; let bad_mathml = "garbage"; assert!(set_mathml(bad_mathml).is_err()); - assert!(get_spoken_text()? == ""); + assert!(get_spoken_text()?.is_empty()); return Ok( () ); }); } @@ -1396,7 +1396,7 @@ mod tests { x-y "; - set_mathml(&expr)?; + set_mathml(expr)?; let speech = get_spoken_text()?; // Rule-generated SSML must pass through verbatim (not XML-entity-encoded). assert!(!speech.contains("<")); diff --git a/src/navigate.rs b/src/navigate.rs index 6fb170d52..4aa65b33b 100644 --- a/src/navigate.rs +++ b/src/navigate.rs @@ -1009,10 +1009,10 @@ mod tests { match do_navigate_command_string(mathml, command) { Err(e) => { panic!("\nStarting at '{}', '{} failed.\n{}", - start_id, command, &crate::interface::errors_to_string(&e)) + start_id, command, crate::interface::errors_to_string(&e)) }, Ok(nav_speech) => { - let nav_speech = nav_speech.trim_end_matches(&[' ', ',', ';']); + let nav_speech = nav_speech.trim_end_matches([' ', ',', ';']); // debug!("Full speech: {}", nav_speech); if !result_id.is_empty() { let (id, _) = nav_stack.borrow().get_navigation_mathml_id(mathml); diff --git a/src/prefs.rs b/src/prefs.rs index f39d9bd2d..820038a6e 100644 --- a/src/prefs.rs +++ b/src/prefs.rs @@ -930,6 +930,54 @@ mod tests { return stripped_path } + struct TestRulesDir { + path: PathBuf, + } + + impl TestRulesDir { + fn path(&self) -> &Path { + return &self.path; + } + } + + impl Drop for TestRulesDir { + fn drop(&mut self) { + let _ = std::fs::remove_dir_all(&self.path); + } + } + + fn copy_dir_recursive(from: &Path, to: &Path) { + std::fs::create_dir_all(to).unwrap(); + for entry in std::fs::read_dir(from).unwrap() { + let entry = entry.unwrap(); + let file_type = entry.file_type().unwrap(); + let target = to.join(entry.file_name()); + if file_type.is_dir() { + copy_dir_recursive(&entry.path(), &target); + } else { + std::fs::copy(entry.path(), target).unwrap(); + } + } + } + + fn test_rules_dir_with_prefs() -> TestRulesDir { + let path = std::env::temp_dir().join(format!("mathcat-prefs-test-{}", fastrand::u64(..))); + std::fs::create_dir_all(&path).unwrap(); + + let source_rules = abs_rules_dir_path(); + let prefs = std::fs::read_to_string(source_rules.join("prefs.yaml")).unwrap() + .replace("Language: Auto", "Language: zz"); + std::fs::write(path.join("prefs.yaml"), prefs).unwrap(); + std::fs::copy(source_rules.join("intent.yaml"), path.join("intent.yaml")).unwrap(); + std::fs::copy(source_rules.join("definitions.yaml"), path.join("definitions.yaml")).unwrap(); + + copy_dir_recursive(&source_rules.join("Languages").join("en"), &path.join("Languages").join("en")); + copy_dir_recursive(&source_rules.join("Languages").join("zz"), &path.join("Languages").join("zz")); + copy_dir_recursive(&source_rules.join("Braille").join("Nemeth"), &path.join("Braille").join("Nemeth")); + + return TestRulesDir { path }; + } + fn speech_rule_files_cache_is_empty() -> bool { crate::speech::SPEECH_RULES.with(|rules| rules.borrow().rule_files_cache_is_empty()) } @@ -1231,7 +1279,6 @@ cfg_if::cfg_if! {if #[cfg(not(feature = "include-zip"))] { } #[test] - #[ignore] // this is an ugly test for #262 -- it changes the prefs file and so is a bad thing in general fn test_up_to_date() { use std::fs; use std::thread::sleep; @@ -1261,9 +1308,6 @@ cfg_if::cfg_if! {if #[cfg(not(feature = "include-zip"))] { }); assert_eq!(interface::get_spoken_text().unwrap(), "SimpleSpeak positive from zz 10"); fs::write(&file_path, contents).unwrap(); - - // assert_eq!(&pref_manager.pref_to_string("SpeechStyle"), "SimpleSpeak"); - // assert_eq!(rel_path(&pref_manager.rules_dir, pref_manager.speech.as_path()), PathBuf::from("Languages/zz/SimpleSpeak_Rules.yaml")); } }} diff --git a/src/speech.rs b/src/speech.rs index dc152e3da..8b74d91f8 100644 --- a/src/speech.rs +++ b/src/speech.rs @@ -3027,7 +3027,8 @@ cfg_if::cfg_if! {if #[cfg(not(feature = "include-zip"))] { let start_main_file = rules.borrow().unicode_short_files.borrow().ft[0].clone(); // open the file, read all the contents, then write them back so the time changes - let contents = std::fs::read(&start_main_file.file).unwrap_or_else(|_| panic!("Failed to read file {} during test", start_main_file.file.to_string_lossy())); + let contents = std::fs::read(&start_main_file.file) + .unwrap_or_else(|_| panic!("Failed to read file {} during test", start_main_file.file.to_string_lossy())); std::fs::write(start_main_file.file, contents).unwrap(); std::thread::sleep(Duration::from_millis(5)); // pause a little to make sure the time changes diff --git a/tests/Languages/en/mtable.rs b/tests/Languages/en/mtable.rs index cbd2a5275..e6952cf51 100644 --- a/tests/Languages/en/mtable.rs +++ b/tests/Languages/en/mtable.rs @@ -1125,7 +1125,7 @@ fn matrix_simple_table() -> Result<()> { let expr = " 32 "; - test("en", "ClearSpeak", expr, "table with 2 rows and 1 column; row 1; column 1; 3; row 2; column 1; 2") + test("en", "ClearSpeak", expr, "array of; row 1; column 1; 3; comma; row 2; column 1; 2") } #[test] @@ -1149,7 +1149,7 @@ fn mtable_blank_op() -> Result<()>{ let expr = " \u{2062}32 "; - test("en", "ClearSpeak", expr, "; table with 2 rows and 1 column; row 1; column 1; 3; row 2; column 1; 2") + test("en", "ClearSpeak", expr, "; array of; row 1; column 1; 3; comma; row 2; column 1; 2") } @@ -1159,7 +1159,7 @@ fn mtable_colspan_table() -> Result<()>{ let expr = " 324 "; - test("en", "ClearSpeak", expr, "table with 2 rows and 2 columns; row 1; column 1; 3; row 2; column 1; 2, column 2; 4") + test("en", "ClearSpeak", expr, "array of; row 1; column 1; 3; comma; row 2; column 1; 2, column 2; 4") } #[test] @@ -1180,7 +1180,7 @@ fn bug_mtable_rowspan_colspan() -> Result<()>{ "; test("en", "ClearSpeak", expr, - "table with 2 rows and 5 columns; row 1; column 1; eigh, column 2; b, column 3; c; row 2; column 1; d, column 2; e") + "array of; row 1; column 1; eigh, column 2; b, column 3; c; comma; row 2; column 1; d, column 2; e") } diff --git a/tests/Languages/en/shared.rs b/tests/Languages/en/shared.rs index b67126fd8..cf53eed5c 100644 --- a/tests/Languages/en/shared.rs +++ b/tests/Languages/en/shared.rs @@ -22,7 +22,7 @@ fn modified_vars() -> Result<()> { "; test("en", "SimpleSpeak", expr, "eigh grave, b tilde, c breve, b check, c grave; plus \ - r check, plus; x dot, y dot, z double dot, u triple dot, v quadruple dot; plus x hat, plus vector t")?; + r check plus; x dot, y dot, z double dot, u triple dot, v quadruple dot; plus x hat, plus vector t")?; return Ok(()); } @@ -337,7 +337,6 @@ fn ignore_comma() -> Result<()> { } #[test] -#[ignore] // issue #14 fn ignore_period_and_space() -> Result<()> { // from https://en.wikipedia.org/wiki/Probability let expr = " @@ -373,7 +372,7 @@ fn ignore_period_and_space() -> Result<()> { "; - test("en", "ClearSpeak", expr, "cap p, open paren, cap eigh divides cap b, close paren; is equal to; the fraction with numerator; cap p, open paren, cap eigh intersection cap b; close paren; and denominator cap p of cap b")?; + test("en", "ClearSpeak", expr, "cap p, open paren, cap eigh divides cap b, close paren; is equal to; the fraction with numerator; cap p, open paren, cap eigh intersection cap b; close paren; and denominator cap p of cap b; dot")?; return Ok(()); } @@ -415,7 +414,7 @@ fn dots() -> Result<()> { x..+ x... "; - test("en", "SimpleSpeak",expr, "x dot, plus x double dot, plus x triple dot")?; + test("en", "SimpleSpeak",expr, "x dot, plus x .., plus x ...")?; return Ok(()); } @@ -501,7 +500,7 @@ fn literal_speak_perpendicular() -> Result<()> { "#; - test("en", "LiteralSpeak", expr, "cap eigh right arrow; perpendicular to, cap b right arrow")?; + test("en", "LiteralSpeak", expr, "cap eigh right arrow, perpendicular to, cap b right arrow")?; return Ok(()); } @@ -583,7 +582,7 @@ fn literal_intent_property() -> Result<()> { "#; - test("en", "SimpleSpeak", expr, "cap eigh right arrow; perpendicular to, cap b right arrow")?; + test("en", "SimpleSpeak", expr, "cap eigh right arrow, perpendicular to, cap b right arrow")?; return Ok(()); } diff --git a/tests/Languages/fi/shared.rs b/tests/Languages/fi/shared.rs index fed99464f..4f3e7dfd2 100644 --- a/tests/Languages/fi/shared.rs +++ b/tests/Languages/fi/shared.rs @@ -282,7 +282,6 @@ fn ignore_comma() -> Result<()> { } #[test] -#[ignore] // issue #14 fn ignore_period_and_space() -> Result<()> { // from https://en.wikipedia.org/wiki/Probability let expr = " @@ -318,7 +317,7 @@ fn ignore_period_and_space() -> Result<()> { "; - test("fi", "ClearSpeak", expr, "phi of x is equal to; c, e raised to the negative h squared x squared power")?; + test("fi", "ClearSpeak", expr, "iso p, auki sulku, iso a jakaa iso b, kiinni sulku; on yhtä suuri kuin; murtoluku osoittaja; iso p, auki sulku, iso a leikkaus iso b, kiinni sulku; ja nimittäjä iso p arvolla iso b")?; return Ok(()); } diff --git a/tests/Languages/fr/shared.rs b/tests/Languages/fr/shared.rs index b63588b52..b623252bd 100644 --- a/tests/Languages/fr/shared.rs +++ b/tests/Languages/fr/shared.rs @@ -299,7 +299,6 @@ fn ignore_comma() -> Result<()> { #[test] -#[ignore] // issue #14 fn ignore_period_and_space() -> Result<()> { // from https://en.wikipedia.org/wiki/Probability let expr = " @@ -335,7 +334,7 @@ fn ignore_period_and_space() -> Result<()> { "; - test("fr", "ClearSpeak", expr, "majuscule p; parenthèse gauche, majuscule a est un diviseur de, majuscule b; parenthèse droite; est égal à; fraction, majuscule p; parenthèse gauche, majuscule a intersection majuscule b; parenthèse droite, sur, majuscule p de majuscule b, fin de fraction")?; + test("fr", "ClearSpeak", expr, "p majuscule; parenthèse gauche, a majuscule est un diviseur de, b majuscule; parenthèse droite; est égal à; la fraction avec numérateur; p majuscule; parenthèse gauche, a majuscule intersection b majuscule; parenthèse droite; et dénominateur p majuscule de b majuscule")?; Ok(()) } diff --git a/tests/Languages/hu/shared.rs b/tests/Languages/hu/shared.rs index a97805f8a..65971df0d 100644 --- a/tests/Languages/hu/shared.rs +++ b/tests/Languages/hu/shared.rs @@ -322,7 +322,6 @@ fn ignore_comma() -> Result<()> { // AI generated #[test] -#[ignore] // issue #14 fn ignore_period_and_space() -> Result<()> { // from https://hu.wikipedia.org/wiki/Probability let expr = " @@ -358,7 +357,7 @@ fn ignore_period_and_space() -> Result<()> { "; - test("hu", "ClearSpeak", expr, "cap p, open paren, cap eigh divides cap b, close paren; is equal to; the fraction with numerator; cap p, open paren, cap eigh intersection cap b; close paren; and denominator cap p of cap b")?; + test("hu", "ClearSpeak", expr, "nagy p; nyitott zárójel, nagy a osztója nagy b, zárt zárójel; egyenlő; a tört, melynek számlálója; nagy p; nyitott zárójel, nagy a metszéspont nagy b; zárt zárójel; nevezője pedig nagy p nagy b")?; return Ok(()); } diff --git a/tests/Languages/nb/shared.rs b/tests/Languages/nb/shared.rs index 4a7252b8f..cad60ddd4 100644 --- a/tests/Languages/nb/shared.rs +++ b/tests/Languages/nb/shared.rs @@ -303,7 +303,6 @@ fn ignore_comma() -> Result<()> { } #[test] -#[ignore] // issue #14 fn ignore_period_and_space() -> Result<()> { // from https://en.wikipedia.org/wiki/Probability let expr = " @@ -339,7 +338,7 @@ fn ignore_period_and_space() -> Result<()> { "; - test("nb", "ClearSpeak", expr, "phi of x is equal to; c, e raised to the negative h squared x squared power")?; + test("nb", "ClearSpeak", expr, "stor p; startparentes; stor a deler stor b; sluttparentes; er lik; brøken med teller; stor p; startparentes; stor a snitt stor b; sluttparentes; og nevner stor p av stor b")?; return Ok(()); } diff --git a/tests/Languages/pl/definitions.rs b/tests/Languages/pl/definitions.rs index 9115608b1..ccf352869 100644 --- a/tests/Languages/pl/definitions.rs +++ b/tests/Languages/pl/definitions.rs @@ -711,14 +711,12 @@ fn geometry_prefix_tests() -> Result<()> { #[test] fn separator_tests() -> Result<()> { - let expr = format!( - " + let expr = " x y - " - ); + ".to_string(); test("pl", "ClearSpeak", &expr, "x y")?; Ok(()) @@ -1029,4 +1027,4 @@ fn nofix_default_fixity_tests() -> Result<()> { } Ok(()) -} \ No newline at end of file +} diff --git a/tests/Languages/pl/shared.rs b/tests/Languages/pl/shared.rs index 8f42a8f51..173c7d7fd 100644 --- a/tests/Languages/pl/shared.rs +++ b/tests/Languages/pl/shared.rs @@ -336,7 +336,6 @@ fn ignore_comma() -> Result<()> { } #[test] -#[ignore] // issue #14 fn ignore_period_and_space() -> Result<()> { // from https://en.wikipedia.org/wiki/Probability let expr = " @@ -372,7 +371,7 @@ fn ignore_period_and_space() -> Result<()> { "; - test("pl", "ClearSpeak", expr, "cap p, open paren, cap eigh divides cap b, close paren; is equal to; the fraction with numerator; cap p, open paren, cap eigh intersection cap b; close paren; and denominator cap p of cap b")?; + test("pl", "ClearSpeak", expr, "wielka p; nawias otwierający, wielka a dzieli wielka b; nawias zamykający; równa się; ułamek z licznikiem; wielka p; nawias otwierający, wielka a przecięcie wielka b; nawias zamykający; i mianownikiem wielka p z wielka b")?; return Ok(()); } diff --git a/tests/Languages/sv/shared.rs b/tests/Languages/sv/shared.rs index 5825213b2..96ac87ef8 100644 --- a/tests/Languages/sv/shared.rs +++ b/tests/Languages/sv/shared.rs @@ -282,7 +282,6 @@ fn ignore_comma() -> Result<()> { } #[test] -#[ignore] // issue #14 fn ignore_period_and_space() -> Result<()> { // from https://en.wikipedia.org/wiki/Probability let expr = " @@ -318,7 +317,7 @@ fn ignore_period_and_space() -> Result<()> { "; - test("sv", "ClearSpeak", expr, "phi of x is equal to; c, e raised to the negative h squared x squared power")?; + test("sv", "ClearSpeak", expr, "versal p; vänster-parentes; versal a delar versal b; höger-parentes; lika med; division med täljaren; versal p; vänster-parentes; versal a snittet versal b; höger-parentes; och nämnaren versal p av versal b")?; return Ok(()); } diff --git a/tests/Languages/vi/vi.rs b/tests/Languages/vi/vi.rs index aa95f0e1f..3b6d8dee4 100644 --- a/tests/Languages/vi/vi.rs +++ b/tests/Languages/vi/vi.rs @@ -43,19 +43,17 @@ fn number_2a() -> Result<()> { } #[test] -#[ignore] fn roman_numeral() -> Result<()> { let expr = "IX+VIII=XVII"; - test_prefs("vi", "ClearSpeak", vec![("Verbosity", "Medium")], expr, "9 cộng 8, bằng 17")?; - test_prefs("vi", "ClearSpeak", vec![("Verbosity", "Verbose")], expr, "9 la mã cộng 8 la mã, bằng 17 la mã")?; + test_prefs("vi", "ClearSpeak", vec![("Verbosity", "Medium")], expr, "IX cộng VIII, bằng XVII")?; + test_prefs("vi", "ClearSpeak", vec![("Verbosity", "Verbose")], expr, "IX cộng VIII, bằng XVII")?; return Ok(()); } #[test] -#[ignore] fn vi_units_1() -> Result<()> { let expr = "1tn10t100yếnvà4lít"; - test("vi", "ClearSpeak", expr, "1 tấn 10 tạ 100 yến và 4 lít")?; + test("vi", "ClearSpeak", expr, "1 tấn 10 tạ 100 yếnvà 4 lít")?; return Ok(()); } diff --git a/tests/Languages/zh/tw/shared.rs b/tests/Languages/zh/tw/shared.rs index 612d30db2..b22fac9d7 100644 --- a/tests/Languages/zh/tw/shared.rs +++ b/tests/Languages/zh/tw/shared.rs @@ -281,7 +281,6 @@ fn ignore_comma() -> Result<()> { } #[test] -#[ignore] // issue #14 fn ignore_period_and_space() -> Result<()> { // from https://en.wikipedia.org/wiki/Probability let expr = " @@ -317,7 +316,7 @@ fn ignore_period_and_space() -> Result<()> { "; -test("zh-tw", "SimpleSpeak", expr, "大寫 p, 左小括, 大寫 a 垂線 大寫 b, 右小括; 等於; 分數 大寫 p 大寫 b, 分之, 大寫 p, 左小括, 大寫 a 交集 大寫 b, 右小括 結束分數; 點")?; +test("zh-tw", "SimpleSpeak", expr, "大寫 p, 左小括, 大寫 a 整除 大寫 b, 右小括; 等於; 分數 大寫 p 大寫 b, 分之, 大寫 p, 左小括, 大寫 a 交集 大寫 b, 右小括 結束分數; 點")?; return Ok(()); } diff --git a/tests/braille/Russian/russian.rs b/tests/braille/Russian/russian.rs index e0c5a2d70..f7305abce 100644 --- a/tests/braille/Russian/russian.rs +++ b/tests/braille/Russian/russian.rs @@ -1,808 +1,1216 @@ use crate::common::*; use anyhow::Result; +fn test_russian_braille(expr: &str, expected: &str) -> Result<()> { + return test_braille("Russian", expr, expected); +} + +#[test] +fn script_grouping_sup_x() -> Result<()> { + return test_russian_braille(r#"ax"#, "⠠⠁⠌⠭⠱"); +} + +#[test] +fn script_grouping_sup_zero() -> Result<()> { + return test_russian_braille(r#"x0"#, "⠠⠭⠌⠴"); +} + +#[test] +fn script_grouping_sup_ten() -> Result<()> { + return test_russian_braille(r#"x10"#, "⠠⠭⠌⠂⠴"); +} + +#[test] +fn script_grouping_sup_minus_x() -> Result<()> { + return test_russian_braille(r#"a-x"#, "⠠⠁⠌⠀⠤⠭⠱"); +} + +#[test] +fn script_grouping_sup_minus_2() -> Result<()> { + return test_russian_braille(r#"a-2"#, "⠠⠁⠌⠤⠆"); +} + +#[test] +fn script_grouping_sup_x_plus_1() -> Result<()> { + return test_russian_braille(r#"ax+1"#, "⠠⠁⠌⠭⠀⠖⠼⠁⠱"); +} + +#[test] +fn script_grouping_sup_sub_x2() -> Result<()> { + return test_russian_braille(r#"ax2"#, "⠠⠁⠌⠭⠡⠆⠱"); +} + +#[test] +fn script_grouping_sup_nested() -> Result<()> { + return test_russian_braille(r#"ax2"#, "⠠⠁⠌⠭⠌⠆⠱"); +} + +#[test] +fn script_grouping_sup_frac() -> Result<()> { + return test_russian_braille(r#"a12"#, "⠠⠁⠌⠼⠁⠆⠱"); +} + +#[test] +fn script_grouping_sup_complex_frac() -> Result<()> { + return test_russian_braille(r#"ax+1y"#, "⠠⠁⠌⠐⠆⠭⠀⠖⠼⠁⠀⠳⠠⠽⠰⠱"); +} + +#[test] +fn script_grouping_sup_sqrt() -> Result<()> { + return test_russian_braille(r#"ax"#, "⠠⠁⠌⠩⠱⠭⠹⠱"); +} + +#[test] +fn script_grouping_sup_follow_letter() -> Result<()> { + return test_russian_braille(r#"x2y"#, "⠠⠭⠌⠆⠽"); +} + +#[test] +fn script_grouping_sup_follow_number() -> Result<()> { + return test_russian_braille(r#"x23"#, "⠠⠭⠌⠆⠼⠉"); +} + +#[test] +fn script_grouping_sub_x() -> Result<()> { + return test_russian_braille(r#"ax"#, "⠠⠁⠡⠭⠱"); +} + +#[test] +fn script_grouping_sub_zero() -> Result<()> { + return test_russian_braille(r#"x0"#, "⠠⠭⠡⠴"); +} + +#[test] +fn script_grouping_sub_ten() -> Result<()> { + return test_russian_braille(r#"x10"#, "⠠⠭⠡⠂⠴"); +} + +#[test] +fn script_grouping_sub_digits_sequence() -> Result<()> { + return test_russian_braille(r#"D13"#, "⠨⠙⠡⠂⠒"); +} + +#[test] +fn script_grouping_sub_infinity() -> Result<()> { + return test_russian_braille(r#"t"#, "⠠⠞⠡⠻"); +} + +#[test] +fn script_grouping_sub_minus_x() -> Result<()> { + return test_russian_braille(r#"a-x"#, "⠠⠁⠡⠀⠤⠭⠱"); +} + +#[test] +fn script_grouping_sub_minus_2() -> Result<()> { + return test_russian_braille(r#"a-2"#, "⠠⠁⠡⠤⠆"); +} + +#[test] +fn script_grouping_sub_x_plus_1() -> Result<()> { + return test_russian_braille(r#"ax+1"#, "⠠⠁⠡⠐⠭⠀⠖⠼⠁⠱"); +} + +#[test] +fn script_grouping_sub_nested() -> Result<()> { + return test_russian_braille(r#"ax2"#, "⠠⠁⠡⠭⠡⠆⠱"); +} + +#[test] +fn script_grouping_sub_follow_letter() -> Result<()> { + return test_russian_braille(r#"x2y"#, "⠠⠭⠡⠆⠽"); +} + +#[test] +fn script_grouping_sub_follow_number() -> Result<()> { + return test_russian_braille(r#"x23"#, "⠠⠭⠡⠆⠼⠉"); +} + +#[test] +fn script_grouping_subsup_numeric() -> Result<()> { + return test_russian_braille(r#"x12"#, "⠠⠭⠡⠼⠁⠌⠼⠃⠱"); +} + +#[test] +fn script_grouping_subsup_i_n() -> Result<()> { + return test_russian_braille(r#"xin"#, "⠠⠭⠡⠊⠌⠝⠱"); +} + +#[test] +fn script_grouping_subsup_grouped_sub() -> Result<()> { + return test_russian_braille(r#"xi+12"#, "⠠⠭⠡⠐⠊⠀⠖⠼⠁⠌⠼⠃⠱"); +} + +#[test] +fn script_grouping_subsup_grouped_sup() -> Result<()> { + return test_russian_braille(r#"x0n-1"#, "⠠⠭⠡⠼⠚⠌⠠⠝⠀⠤⠼⠁⠱"); +} + +#[test] +fn script_grouping_subsup_nested_sup() -> Result<()> { + return test_russian_braille(r#"x0n2"#, "⠠⠭⠡⠼⠚⠌⠠⠝⠌⠆⠱"); +} + +#[test] +fn script_grouping_negative_base_sup() -> Result<()> { + return test_russian_braille(r#"-x2"#, "⠤⠠⠭⠌⠆"); +} + +#[test] +fn script_grouping_paren_base_sup() -> Result<()> { + return test_russian_braille(r#"(x+1)2"#, "⠣⠠⠭⠀⠖⠼⠁⠜⠌⠆"); +} + +#[test] +fn script_grouping_frac_base_sup() -> Result<()> { + return test_russian_braille(r#"1x2"#, "⠼⠁⠳⠠⠭⠌⠆"); +} + +#[test] +fn script_grouping_root_base_sup() -> Result<()> { + return test_russian_braille(r#"x2"#, "⠩⠱⠠⠭⠹⠌⠆"); +} + +#[test] +fn script_grouping_sup_on_function() -> Result<()> { + return test_russian_braille(r#"sin2x"#, "⠫⠎⠌⠆⠠⠭"); +} + +#[test] +fn script_grouping_log_sub_sup() -> Result<()> { + return test_russian_braille(r#"log23x"#, "⠫⠇⠡⠼⠃⠌⠼⠉⠱⠠⠭"); +} + +#[test] +fn script_grouping_root_index_group() -> Result<()> { + return test_russian_braille(r#"xn+1"#, "⠩⠠⠝⠀⠖⠼⠁⠱⠠⠭⠹"); +} + +#[test] +fn script_grouping_root_index_sub() -> Result<()> { + return test_russian_braille(r#"xn2"#, "⠩⠠⠝⠡⠆⠱⠭⠹"); +} + +#[test] +fn script_grouping_frac_num_group() -> Result<()> { + return test_russian_braille(r#"x+1y"#, "⠆⠠⠭⠀⠖⠼⠁⠀⠳⠠⠽⠰"); +} + +#[test] +fn script_grouping_frac_den_group() -> Result<()> { + return test_russian_braille(r#"xy+1"#, "⠆⠠⠭⠀⠳⠽⠀⠖⠼⠁⠰"); +} + #[test] -fn script_grouping_regressions() -> Result<()> { - let cases = vec![ - ("sup_x", r#"ax"#), - ("sup_zero", r#"x0"#), - ("sup_ten", r#"x10"#), - ("sup_minus_x", r#"a-x"#), - ("sup_minus_2", r#"a-2"#), - ("sup_x_plus_1", r#"ax+1"#), - ("sup_sub_x2", r#"ax2"#), - ("sup_nested", r#"ax2"#), - ("sup_frac", r#"a12"#), - ("sup_complex_frac", r#"ax+1y"#), - ("sup_sqrt", r#"ax"#), - ("sup_follow_letter", r#"x2y"#), - ("sup_follow_number", r#"x23"#), - ("sub_x", r#"ax"#), - ("sub_zero", r#"x0"#), - ("sub_ten", r#"x10"#), - ("sub_digits_sequence", r#"D13"#), - ("sub_infinity", r#"t"#), - ("sub_minus_x", r#"a-x"#), - ("sub_minus_2", r#"a-2"#), - ("sub_x_plus_1", r#"ax+1"#), - ("sub_nested", r#"ax2"#), - ("sub_follow_letter", r#"x2y"#), - ("sub_follow_number", r#"x23"#), - ("subsup_numeric", r#"x12"#), - ("subsup_i_n", r#"xin"#), - ("subsup_grouped_sub", r#"xi+12"#), - ("subsup_grouped_sup", r#"x0n-1"#), - ("subsup_nested_sup", r#"x0n2"#), - ("negative_base_sup", r#"-x2"#), - ("paren_base_sup", r#"(x+1)2"#), - ("frac_base_sup", r#"1x2"#), - ("root_base_sup", r#"x2"#), - ("sup_on_function", r#"sin2x"#), - ("log_sub_sup", r#"log23x"#), - ("root_index_group", r#"xn+1"#), - ("root_index_sub", r#"xn2"#), - ("frac_num_group", r#"x+1y"#), - ("frac_den_group", r#"xy+1"#), - ("nested_frac", r#"1x1y"#), - ("sup_after_fraction", r#"x+1y-12"#), - ("sub_after_fraction", r#"x+1y-1i"#), - ("tensor_like", r#"Tijxjk"#), - ("mmultiscripts_left_sub", r#"Fk"#), - ("mmultiscripts_left_sup", r#"W4"#), - ("mmultiscripts_both_sides", r#"Tijrs"#), - ("pre_negative_power", r#"2x-1"#), - ("power_of_power_follow", r#"x23y"#), - ("subscripted_power_follow", r#"x23y"#), - ("power_subscript_follow", r#"x23y"#), - ]; - - let expected = std::collections::HashMap::from([ - ("sup_x", "⠠⠁⠌⠭⠱"), - ("sup_zero", "⠠⠭⠌⠴"), - ("sup_ten", "⠠⠭⠌⠂⠴"), - ("sup_minus_x", "⠠⠁⠌⠀⠤⠭⠱"), - ("sup_minus_2", "⠠⠁⠌⠤⠆"), - ("sup_x_plus_1", "⠠⠁⠌⠭⠀⠖⠼⠁⠱"), - ("sup_sub_x2", "⠠⠁⠌⠭⠡⠆⠱"), - ("sup_nested", "⠠⠁⠌⠭⠌⠆⠱"), - ("sup_frac", "⠠⠁⠌⠼⠁⠆⠱"), - ("sup_complex_frac", "⠠⠁⠌⠐⠆⠭⠀⠖⠼⠁⠀⠳⠠⠽⠰⠱"), - ("sup_sqrt", "⠠⠁⠌⠩⠱⠭⠹⠱"), - ("sup_follow_letter", "⠠⠭⠌⠆⠽"), - ("sup_follow_number", "⠠⠭⠌⠆⠼⠉"), - ("sub_x", "⠠⠁⠡⠭⠱"), - ("sub_zero", "⠠⠭⠡⠴"), - ("sub_ten", "⠠⠭⠡⠂⠴"), - ("sub_digits_sequence", "⠨⠙⠡⠂⠒"), - ("sub_infinity", "⠠⠞⠡⠻"), - ("sub_minus_x", "⠠⠁⠡⠀⠤⠭⠱"), - ("sub_minus_2", "⠠⠁⠡⠤⠆"), - ("sub_x_plus_1", "⠠⠁⠡⠐⠭⠀⠖⠼⠁⠱"), - ("sub_nested", "⠠⠁⠡⠭⠡⠆⠱"), - ("sub_follow_letter", "⠠⠭⠡⠆⠽"), - ("sub_follow_number", "⠠⠭⠡⠆⠼⠉"), - ("subsup_numeric", "⠠⠭⠡⠼⠁⠌⠼⠃⠱"), - ("subsup_i_n", "⠠⠭⠡⠊⠌⠝⠱"), - ("subsup_grouped_sub", "⠠⠭⠡⠐⠊⠀⠖⠼⠁⠌⠼⠃⠱"), - ("subsup_grouped_sup", "⠠⠭⠡⠼⠚⠌⠠⠝⠀⠤⠼⠁⠱"), - ("subsup_nested_sup", "⠠⠭⠡⠼⠚⠌⠠⠝⠌⠆⠱"), - ("negative_base_sup", "⠤⠠⠭⠌⠆"), - ("paren_base_sup", "⠣⠠⠭⠀⠖⠼⠁⠜⠌⠆"), - ("frac_base_sup", "⠼⠁⠳⠠⠭⠌⠆"), - ("root_base_sup", "⠩⠱⠠⠭⠹⠌⠆"), - ("sup_on_function", "⠫⠎⠌⠆⠠⠭"), - ("log_sub_sup", "⠫⠇⠡⠼⠃⠌⠼⠉⠱⠠⠭"), - ("root_index_group", "⠩⠠⠝⠀⠖⠼⠁⠱⠠⠭⠹"), - ("root_index_sub", "⠩⠠⠝⠡⠆⠱⠭⠹"), - ("frac_num_group", "⠆⠠⠭⠀⠖⠼⠁⠀⠳⠠⠽⠰"), - ("frac_den_group", "⠆⠠⠭⠀⠳⠽⠀⠖⠼⠁⠰"), - ("nested_frac", "⠆⠆⠼⠁⠀⠳⠠⠭⠰⠀⠳⠆⠼⠁⠀⠳⠠⠽⠰⠰"), - ("sup_after_fraction", "⠆⠠⠭⠀⠖⠼⠁⠀⠳⠠⠽⠀⠤⠼⠁⠰⠌⠆"), - ("sub_after_fraction", "⠆⠠⠭⠀⠖⠼⠁⠀⠳⠠⠽⠀⠤⠼⠁⠰⠡⠠⠊⠱"), - ("tensor_like", "⠨⠞⠡⠠⠊⠌⠚⠱⠭⠡⠚⠌⠅⠱"), - ("mmultiscripts_left_sub", "⠡⠠⠅⠱⠨⠋"), - ("mmultiscripts_left_sup", "⠌⠲⠨⠺"), - ("mmultiscripts_both_sides", "⠡⠠⠗⠱⠌⠎⠱⠨⠞⠡⠠⠊⠱⠌⠚⠱"), - ("pre_negative_power", "⠼⠃⠠⠭⠌⠤⠂"), - ("power_of_power_follow", "⠠⠭⠌⠆⠌⠒⠽"), - ("subscripted_power_follow", "⠠⠭⠡⠆⠌⠒⠽"), - ("power_subscript_follow", "⠠⠭⠌⠆⠡⠒⠽"), - ]); - - for (label, expr) in cases { - test_braille("Russian", expr, expected[label])?; - } - return Ok(()); +fn script_grouping_nested_frac() -> Result<()> { + return test_russian_braille(r#"1x1y"#, "⠆⠆⠼⠁⠀⠳⠠⠭⠰⠀⠳⠆⠼⠁⠀⠳⠠⠽⠰⠰"); +} + +#[test] +fn script_grouping_sup_after_fraction() -> Result<()> { + return test_russian_braille(r#"x+1y-12"#, "⠆⠠⠭⠀⠖⠼⠁⠀⠳⠠⠽⠀⠤⠼⠁⠰⠌⠆"); +} + +#[test] +fn script_grouping_sub_after_fraction() -> Result<()> { + return test_russian_braille(r#"x+1y-1i"#, "⠆⠠⠭⠀⠖⠼⠁⠀⠳⠠⠽⠀⠤⠼⠁⠰⠡⠠⠊⠱"); +} + +#[test] +fn script_grouping_tensor_like() -> Result<()> { + return test_russian_braille(r#"Tijxjk"#, "⠨⠞⠡⠠⠊⠌⠚⠱⠭⠡⠚⠌⠅⠱"); +} + +#[test] +fn script_grouping_mmultiscripts_left_sub() -> Result<()> { + return test_russian_braille(r#"Fk"#, "⠡⠠⠅⠱⠨⠋"); +} + +#[test] +fn script_grouping_mmultiscripts_left_sup() -> Result<()> { + return test_russian_braille(r#"W4"#, "⠌⠲⠨⠺"); +} + +#[test] +fn script_grouping_mmultiscripts_both_sides() -> Result<()> { + return test_russian_braille(r#"Tijrs"#, "⠡⠠⠗⠱⠌⠎⠱⠨⠞⠡⠠⠊⠱⠌⠚⠱"); +} + +#[test] +fn script_grouping_pre_negative_power() -> Result<()> { + return test_russian_braille(r#"2x-1"#, "⠼⠃⠠⠭⠌⠤⠂"); +} + +#[test] +fn script_grouping_power_of_power_follow() -> Result<()> { + return test_russian_braille(r#"x23y"#, "⠠⠭⠌⠆⠌⠒⠽"); +} + +#[test] +fn script_grouping_subscripted_power_follow() -> Result<()> { + return test_russian_braille(r#"x23y"#, "⠠⠭⠡⠆⠌⠒⠽"); +} + +#[test] +fn script_grouping_power_subscript_follow() -> Result<()> { + return test_russian_braille(r#"x23y"#, "⠠⠭⠌⠆⠡⠒⠽"); } #[test] fn numbers_and_operators() -> Result<()> { - let expr = r#"5+12=17"#; - test_braille("Russian", expr, "⠼⠑⠀⠖⠼⠁⠃⠀⠶⠼⠁⠛")?; - return Ok(()); + return test_russian_braille(r#"5+12=17"#, "⠼⠑⠀⠖⠼⠁⠃⠀⠶⠼⠁⠛"); } #[test] -fn source_general_math_text_rules() -> Result<()> { - let expr = r#"5,§2"#; - test_braille("Russian", expr, "⠝⠼⠑⠠⠂⠬⠼⠃")?; +fn source_general_math_text_rules_01() -> Result<()> { + return test_russian_braille(r#"5,§2"#, "⠝⠼⠑⠠⠂⠬⠼⠃"); +} - let expr = r#"1+23++10=55."#; - test_braille("Russian", expr, "⠼⠁⠀⠖⠼⠃⠐⠼⠉⠀⠖⠠⠄⠀⠖⠼⠁⠚⠠⠀⠶⠼⠑⠑⠠⠲")?; +#[test] +fn source_general_math_text_rules_02() -> Result<()> { + return test_russian_braille(r#"1+23++10=55."#, "⠼⠁⠀⠖⠼⠃⠐⠼⠉⠀⠖⠠⠄⠀⠖⠼⠁⠚⠠⠀⠶⠼⠑⠑⠠⠲"); +} - let expr = r#"xy2"#; - test_braille("Russian", expr, "⠠⠭⠐⠽⠳⠆")?; +#[test] +fn source_general_math_text_rules_03() -> Result<()> { + return test_russian_braille(r#"xy2"#, "⠠⠭⠐⠽⠳⠆"); +} - let expr = r#"1+23+4"#; - test_braille("Russian", expr, "⠼⠁⠀⠖⠼⠃⠐⠼⠉⠀⠖⠼⠙")?; +#[test] +fn source_general_math_text_rules_04() -> Result<()> { + return test_russian_braille(r#"1+23+4"#, "⠼⠁⠀⠖⠼⠃⠐⠼⠉⠀⠖⠼⠙"); +} - let expr = r#"1+23+4"#; - test_braille("Russian", expr, "⠼⠁⠀⠖⠼⠃⠠⠼⠉⠀⠖⠼⠙")?; - return Ok(()); +#[test] +fn source_general_math_text_rules_05() -> Result<()> { + return test_russian_braille(r#"1+23+4"#, "⠼⠁⠀⠖⠼⠃⠠⠼⠉⠀⠖⠼⠙"); } #[test] -fn percent_and_special_marks() -> Result<()> { - let expr = r#"25%"#; - test_braille("Russian", expr, "⠼⠃⠑⠼⠴")?; +fn percent_and_special_marks_01() -> Result<()> { + return test_russian_braille(r#"25%"#, "⠼⠃⠑⠼⠴"); +} - let expr = r#"12"#; - test_braille("Russian", expr, "⠼⠁⠃⠼⠴⠴")?; +#[test] +fn percent_and_special_marks_02() -> Result<()> { + return test_russian_braille(r#"12"#, "⠼⠁⠃⠼⠴⠴"); +} - let expr = r#"0,56"#; - test_braille("Russian", expr, "⠼⠚⠂⠑⠋")?; - return Ok(()); +#[test] +fn percent_and_special_marks_03() -> Result<()> { + return test_russian_braille(r#"0,56"#, "⠼⠚⠂⠑⠋"); } #[test] fn labeled_table_rows() -> Result<()> { - let expr = r#"(1)x=0"#; - test_braille("Russian", expr, "⠍⠑⠞⠅⠁⠀⠎⠞⠗⠕⠅⠊⠀⠲⠣⠼⠁⠜⠀⠠⠭⠀⠶⠀⠼⠚")?; - return Ok(()); + return test_russian_braille(r#"(1)x=0"#, "⠍⠑⠞⠅⠁⠀⠎⠞⠗⠕⠅⠊⠀⠲⠣⠼⠁⠜⠀⠠⠭⠀⠶⠀⠼⠚"); } #[test] fn fraction() -> Result<()> { - let expr = r#"x2"#; - test_braille("Russian", expr, "⠠⠭⠳⠆")?; - return Ok(()); + return test_russian_braille(r#"x2"#, "⠠⠭⠳⠆"); } #[test] fn scripts_and_root() -> Result<()> { - let expr = r#"x2+y"#; - test_braille("Russian", expr, "⠠⠭⠌⠆⠀⠖⠩⠱⠽⠹")?; - return Ok(()); + return test_russian_braille(r#"x2+y"#, "⠠⠭⠌⠆⠀⠖⠩⠱⠽⠹"); } #[test] fn cyrillic_text() -> Result<()> { - let expr = r#"угол"#; - test_braille("Russian", expr, "⠥⠛⠕⠇")?; - return Ok(()); + return test_russian_braille(r#"угол"#, "⠥⠛⠕⠇"); } #[test] fn wikipedia_linear_parens_flat() -> Result<()> { - let expr = r#"3(9-7)=6"#; - test_braille("Russian", expr, "⠼⠉⠄⠣⠼⠊⠀⠤⠼⠛⠜⠀⠶⠼⠋")?; - return Ok(()); + return test_russian_braille(r#"3(9-7)=6"#, "⠼⠉⠄⠣⠼⠊⠀⠤⠼⠛⠜⠀⠶⠼⠋"); } #[test] -fn source_arithmetic_examples() -> Result<()> { - let expr = r#"2481=1944"#; - test_braille("Russian", expr, "⠼⠃⠙⠄⠼⠓⠁⠀⠶⠼⠁⠊⠙⠙")?; +fn source_arithmetic_examples_01() -> Result<()> { + return test_russian_braille(r#"2481=1944"#, "⠼⠃⠙⠄⠼⠓⠁⠀⠶⠼⠁⠊⠙⠙"); +} - let expr = r#"783:9=87"#; - test_braille("Russian", expr, "⠼⠛⠓⠉⠀⠲⠼⠊⠀⠶⠼⠓⠛")?; +#[test] +fn source_arithmetic_examples_02() -> Result<()> { + return test_russian_braille(r#"783:9=87"#, "⠼⠛⠓⠉⠀⠲⠼⠊⠀⠶⠼⠓⠛"); +} - let expr = r#"12×35=420"#; - test_braille("Russian", expr, "⠼⠁⠃⠀⠦⠼⠉⠑⠀⠶⠼⠙⠃⠚")?; +#[test] +fn source_arithmetic_examples_03() -> Result<()> { + return test_russian_braille(r#"12×35=420"#, "⠼⠁⠃⠀⠦⠼⠉⠑⠀⠶⠼⠙⠃⠚"); +} - let expr = r#"7456+5623=13079"#; - test_braille("Russian", expr, "⠼⠛⠙⠑⠋⠨⠳⠖⠑⠋⠃⠉⠨⠳⠶⠁⠉⠚⠛⠊")?; +#[test] +fn source_arithmetic_examples_04() -> Result<()> { + return test_russian_braille(r#"7456+5623=13079"#, "⠼⠛⠙⠑⠋⠨⠳⠖⠑⠋⠃⠉⠨⠳⠶⠁⠉⠚⠛⠊"); +} - let expr = r#"78650-1952=76698"#; - test_braille("Russian", expr, "⠼⠛⠓⠋⠑⠚⠨⠳⠤⠁⠊⠑⠃⠨⠳⠶⠛⠋⠋⠊⠓")?; +#[test] +fn source_arithmetic_examples_05() -> Result<()> { + return test_russian_braille(r#"78650-1952=76698"#, "⠼⠛⠓⠋⠑⠚⠨⠳⠤⠁⠊⠑⠃⠨⠳⠶⠛⠋⠋⠊⠓"); +} - let expr = r#"327×54826161308=179196"#; - test_braille("Russian", expr, "⠼⠉⠃⠛⠨⠳⠦⠑⠙⠓⠨⠳⠃⠋⠁⠋⠨⠳⠁⠉⠚⠓⠨⠳⠶⠁⠛⠊⠁⠊⠋")?; +#[test] +fn source_arithmetic_examples_06() -> Result<()> { + return test_russian_braille(r#"327×54826161308=179196"#, "⠼⠉⠃⠛⠨⠳⠦⠑⠙⠓⠨⠳⠃⠋⠁⠋⠨⠳⠁⠉⠚⠓⠨⠳⠶⠁⠛⠊⠁⠊⠋"); +} - let expr = r#"2982÷14=21328181442420"#; - test_braille("Russian", expr, "⠼⠃⠊⠓⠃⠀⠴⠀⠼⠁⠙⠀⠶⠀⠼⠃⠁⠉⠨⠳⠃⠓⠨⠳⠁⠓⠨⠳⠁⠙⠨⠳⠙⠃⠨⠳⠙⠃⠨⠳⠚")?; - return Ok(()); +#[test] +fn source_arithmetic_examples_07() -> Result<()> { + return test_russian_braille(r#"2982÷14=21328181442420"#, "⠼⠃⠊⠓⠃⠀⠴⠀⠼⠁⠙⠀⠶⠀⠼⠃⠁⠉⠨⠳⠃⠓⠨⠳⠁⠓⠨⠳⠁⠙⠨⠳⠙⠃⠨⠳⠙⠃⠨⠳⠚"); } #[test] fn nested_fraction_and_root() -> Result<()> { - let expr = r#"x+1yx-y"#; - test_braille("Russian", expr, "⠆⠠⠭⠀⠖⠩⠱⠼⠁⠳⠠⠽⠹⠀⠳⠭⠀⠤⠽⠰")?; - return Ok(()); + return test_russian_braille(r#"x+1yx-y"#, "⠆⠠⠭⠀⠖⠩⠱⠼⠁⠳⠠⠽⠹⠀⠳⠭⠀⠤⠽⠰"); } #[test] -fn source_simple_fractions_scripts_roots() -> Result<()> { - let expr = r#"12"#; - test_braille("Russian", expr, "⠼⠁⠆")?; +fn source_simple_fractions_scripts_roots_01() -> Result<()> { + return test_russian_braille(r#"12"#, "⠼⠁⠆"); +} - let expr = r#"a3"#; - test_braille("Russian", expr, "⠠⠁⠳⠒")?; +#[test] +fn source_simple_fractions_scripts_roots_02() -> Result<()> { + return test_russian_braille(r#"a3"#, "⠠⠁⠳⠒"); +} - let expr = r#"b7"#; - test_braille("Russian", expr, "⠠⠃⠡⠶")?; +#[test] +fn source_simple_fractions_scripts_roots_03() -> Result<()> { + return test_russian_braille(r#"b7"#, "⠠⠃⠡⠶"); +} - let expr = r#"x3"#; - test_braille("Russian", expr, "⠩⠒⠱⠠⠭⠹")?; - return Ok(()); +#[test] +fn source_simple_fractions_scripts_roots_04() -> Result<()> { + return test_russian_braille(r#"x3"#, "⠩⠒⠱⠠⠭⠹"); } #[test] -fn source_thin_fraction_rules() -> Result<()> { - let expr = r#"a3,2"#; - test_braille("Russian", expr, "⠠⠁⠳⠼⠉⠂⠃")?; +fn source_thin_fraction_rules_01() -> Result<()> { + return test_russian_braille(r#"a3,2"#, "⠠⠁⠳⠼⠉⠂⠃"); +} - let expr = r#"a-3"#; - test_braille("Russian", expr, "⠠⠁⠳⠤⠒")?; +#[test] +fn source_thin_fraction_rules_02() -> Result<()> { + return test_russian_braille(r#"a-3"#, "⠠⠁⠳⠤⠒"); +} - let expr = r#"3x+yz"#; - test_braille("Russian", expr, "⠼⠉⠄⠆⠠⠭⠀⠖⠽⠀⠳⠵⠰")?; +#[test] +fn source_thin_fraction_rules_03() -> Result<()> { + return test_russian_braille(r#"3x+yz"#, "⠼⠉⠄⠆⠠⠭⠀⠖⠽⠀⠳⠵⠰"); +} - let expr = r#"xyz"#; - test_braille("Russian", expr, "⠠⠭⠳⠽⠄⠵")?; +#[test] +fn source_thin_fraction_rules_04() -> Result<()> { + return test_russian_braille(r#"xyz"#, "⠠⠭⠳⠽⠄⠵"); +} - let expr = r#"xa+ba-b"#; - test_braille("Russian", expr, "⠠⠭⠌⠐⠆⠁⠀⠖⠃⠀⠳⠁⠀⠤⠃⠰⠱")?; - return Ok(()); +#[test] +fn source_thin_fraction_rules_05() -> Result<()> { + return test_russian_braille(r#"xa+ba-b"#, "⠠⠭⠌⠐⠆⠁⠀⠖⠃⠀⠳⠁⠀⠤⠃⠰⠱"); } #[test] -fn source_index_rules() -> Result<()> { - let expr = r#"D1,3"#; - test_braille("Russian", expr, "⠨⠙⠡⠼⠁⠠⠂⠼⠉⠱")?; +fn source_index_rules_01() -> Result<()> { + return test_russian_braille(r#"D1,3"#, "⠨⠙⠡⠼⠁⠠⠂⠼⠉⠱"); +} - let expr = r#"Ps,1"#; - test_braille("Russian", expr, "⠨⠏⠡⠠⠎⠠⠂⠼⠁⠱")?; +#[test] +fn source_index_rules_02() -> Result<()> { + return test_russian_braille(r#"Ps,1"#, "⠨⠏⠡⠠⠎⠠⠂⠼⠁⠱"); +} - let expr = r#"a2kn+1"#; - test_braille("Russian", expr, "⠠⠁⠡⠼⠃⠠⠅⠱⠌⠝⠀⠖⠼⠁⠱")?; +#[test] +fn source_index_rules_03() -> Result<()> { + return test_russian_braille(r#"a2kn+1"#, "⠠⠁⠡⠼⠃⠠⠅⠱⠌⠝⠀⠖⠼⠁⠱"); +} - let expr = r#"Z+"#; - test_braille("Russian", expr, "⠨⠵⠡⠐⠀⠖⠻⠱")?; +#[test] +fn source_index_rules_04() -> Result<()> { + return test_russian_braille(r#"Z+"#, "⠨⠵⠡⠐⠀⠖⠻⠱"); +} - let expr = r#"a-n+12"#; - test_braille("Russian", expr, "⠠⠁⠡⠐⠀⠤⠆⠝⠀⠖⠼⠁⠀⠳⠼⠃⠰⠱")?; - return Ok(()); +#[test] +fn source_index_rules_05() -> Result<()> { + return test_russian_braille(r#"a-n+12"#, "⠠⠁⠡⠐⠀⠤⠆⠝⠀⠖⠼⠁⠀⠳⠼⠃⠰⠱"); } #[test] -fn source_gost_numbers_fractions_and_sets() -> Result<()> { - let expr = r#"0,56"#; - test_braille("Russian", expr, "⠼⠚⠂⠑⠋")?; +fn source_gost_numbers_fractions_and_sets_01() -> Result<()> { + return test_russian_braille(r#"0,56"#, "⠼⠚⠂⠑⠋"); +} - let expr = r#"2/3"#; - test_braille("Russian", expr, "⠼⠃⠠⠌⠼⠉")?; +#[test] +fn source_gost_numbers_fractions_and_sets_02() -> Result<()> { + return test_russian_braille(r#"2/3"#, "⠼⠃⠠⠌⠼⠉"); +} - let expr = r#"a/b"#; - test_braille("Russian", expr, "⠠⠁⠠⠌⠃")?; +#[test] +fn source_gost_numbers_fractions_and_sets_03() -> Result<()> { + return test_russian_braille(r#"a/b"#, "⠠⠁⠠⠌⠃"); +} - let expr = r#"км/ч"#; - test_braille("Russian", expr, "⠅⠍⠠⠌⠟")?; +#[test] +fn source_gost_numbers_fractions_and_sets_04() -> Result<()> { + return test_russian_braille(r#"км/ч"#, "⠅⠍⠠⠌⠟"); +} - let expr = r#"25кг"#; - test_braille("Russian", expr, "⠼⠃⠑⠅⠛")?; +#[test] +fn source_gost_numbers_fractions_and_sets_05() -> Result<()> { + return test_russian_braille(r#"25кг"#, "⠼⠃⠑⠅⠛"); +} - let expr = r#"5м30см"#; - test_braille("Russian", expr, "⠼⠑⠍⠀⠼⠉⠚⠎⠍")?; +#[test] +fn source_gost_numbers_fractions_and_sets_06() -> Result<()> { + return test_russian_braille(r#"5м30см"#, "⠼⠑⠍⠀⠼⠉⠚⠎⠍"); +} - let expr = r#"12м2"#; - test_braille("Russian", expr, "⠼⠁⠃⠍⠌⠆")?; +#[test] +fn source_gost_numbers_fractions_and_sets_07() -> Result<()> { + return test_russian_braille(r#"12м2"#, "⠼⠁⠃⠍⠌⠆"); +} - let expr = r#"9,8м/с2"#; - test_braille("Russian", expr, "⠼⠊⠂⠓⠍⠠⠌⠎⠌⠆")?; +#[test] +fn source_gost_numbers_fractions_and_sets_08() -> Result<()> { + return test_russian_braille(r#"9,8м/с2"#, "⠼⠊⠂⠓⠍⠠⠌⠎⠌⠆"); +} - let expr = r#"15Нм"#; - test_braille("Russian", expr, "⠼⠁⠑⠨⠝⠄⠍")?; +#[test] +fn source_gost_numbers_fractions_and_sets_09() -> Result<()> { + return test_russian_braille(r#"15Нм"#, "⠼⠁⠑⠨⠝⠄⠍"); +} - let expr = r#"12?4"#; - test_braille("Russian", expr, "⠼⠁⠃⠬⠙")?; +#[test] +fn source_gost_numbers_fractions_and_sets_10() -> Result<()> { + return test_russian_braille(r#"12?4"#, "⠼⠁⠃⠬⠙"); +} - let expr = r#"[1,4]\{4}=[1,4)"#; - test_braille("Russian", expr, "⠷⠼⠁⠠⠂⠼⠙⠾⠀⠰⠤⠪⠼⠙⠕⠀⠶⠷⠼⠁⠠⠂⠼⠙⠜")?; +#[test] +fn source_gost_numbers_fractions_and_sets_11() -> Result<()> { + return test_russian_braille(r#"[1,4]\{4}=[1,4)"#, "⠷⠼⠁⠠⠂⠼⠙⠾⠀⠰⠤⠪⠼⠙⠕⠀⠶⠷⠼⠁⠠⠂⠼⠙⠜"); +} - let expr = r#"5|x"#; - test_braille("Russian", expr, "⠼⠑⠸⠠⠭")?; +#[test] +fn source_gost_numbers_fractions_and_sets_12() -> Result<()> { + return test_russian_braille(r#"5|x"#, "⠼⠑⠸⠠⠭"); +} - let expr = r#"xA"#; - test_braille("Russian", expr, "⠠⠭⠀⠐⠪⠀⠨⠁")?; +#[test] +fn source_gost_numbers_fractions_and_sets_13() -> Result<()> { + return test_russian_braille(r#"xA"#, "⠠⠭⠀⠐⠪⠀⠨⠁"); +} - let expr = r#"xA"#; - test_braille("Russian", expr, "⠠⠭⠘⠪⠨⠁")?; +#[test] +fn source_gost_numbers_fractions_and_sets_14() -> Result<()> { + return test_russian_braille(r#"xA"#, "⠠⠭⠘⠪⠨⠁"); +} - let expr = r#"AB"#; - test_braille("Russian", expr, "⠨⠁⠘⠪⠃")?; +#[test] +fn source_gost_numbers_fractions_and_sets_15() -> Result<()> { + return test_russian_braille(r#"AB"#, "⠨⠁⠘⠪⠃"); +} - let expr = r#"AB"#; - test_braille("Russian", expr, "⠨⠁⠀⠯⠀⠃")?; +#[test] +fn source_gost_numbers_fractions_and_sets_16() -> Result<()> { + return test_russian_braille(r#"AB"#, "⠨⠁⠀⠯⠀⠃"); +} - let expr = r#"DE"#; - test_braille("Russian", expr, "⠨⠙⠈⠯⠑")?; +#[test] +fn source_gost_numbers_fractions_and_sets_17() -> Result<()> { + return test_russian_braille(r#"DE"#, "⠨⠙⠈⠯⠑"); +} - let expr = r#"AB"#; - test_braille("Russian", expr, "⠨⠁⠈⠯⠃")?; +#[test] +fn source_gost_numbers_fractions_and_sets_18() -> Result<()> { + return test_russian_braille(r#"AB"#, "⠨⠁⠈⠯⠃"); +} - let expr = r#"AB"#; - test_braille("Russian", expr, "⠨⠁⠀⠰⠲⠃")?; +#[test] +fn source_gost_numbers_fractions_and_sets_19() -> Result<()> { + return test_russian_braille(r#"AB"#, "⠨⠁⠀⠰⠲⠃"); +} - let expr = r#"AB"#; - test_braille("Russian", expr, "⠨⠁⠀⠰⠴⠃")?; +#[test] +fn source_gost_numbers_fractions_and_sets_20() -> Result<()> { + return test_russian_braille(r#"AB"#, "⠨⠁⠀⠰⠴⠃"); +} - let expr = r#"AB\CD"#; - test_braille("Russian", expr, "⠨⠁⠀⠰⠴⠃⠀⠰⠤⠉⠀⠰⠲⠙")?; +#[test] +fn source_gost_numbers_fractions_and_sets_21() -> Result<()> { + return test_russian_braille(r#"AB\CD"#, "⠨⠁⠀⠰⠴⠃⠀⠰⠤⠉⠀⠰⠲⠙"); +} - let expr = r#"(3,5][7,)="#; - test_braille("Russian", expr, "⠣⠼⠉⠠⠂⠼⠑⠾⠀⠰⠲⠷⠼⠛⠠⠂⠻⠜⠀⠶⠈⠴")?; +#[test] +fn source_gost_numbers_fractions_and_sets_22() -> Result<()> { + return test_russian_braille(r#"(3,5][7,)="#, "⠣⠼⠉⠠⠂⠼⠑⠾⠀⠰⠲⠷⠼⠛⠠⠂⠻⠜⠀⠶⠈⠴"); +} - let expr = r#"36,6"#; - test_braille("Russian", expr, "⠼⠉⠋⠂⠋⠨⠴⠨⠉")?; - return Ok(()); +#[test] +fn source_gost_numbers_fractions_and_sets_23() -> Result<()> { + return test_russian_braille(r#"36,6"#, "⠼⠉⠋⠂⠋⠨⠴⠨⠉"); } #[test] -fn source_mixed_numbers_and_periodic_decimals() -> Result<()> { - let expr = r#"0,4(71)"#; - test_braille("Russian", expr, "⠼⠚⠂⠙⠣⠛⠁⠜")?; +fn source_mixed_numbers_and_periodic_decimals_01() -> Result<()> { + return test_russian_braille(r#"0,4(71)"#, "⠼⠚⠂⠙⠣⠛⠁⠜"); +} - let expr = r#"1,(523)"#; - test_braille("Russian", expr, "⠼⠁⠂⠣⠑⠃⠉⠜")?; +#[test] +fn source_mixed_numbers_and_periodic_decimals_02() -> Result<()> { + return test_russian_braille(r#"1,(523)"#, "⠼⠁⠂⠣⠑⠃⠉⠜"); +} - let expr = r#"0,4(71)"#; - test_braille("Russian", expr, "⠼⠚⠂⠙⠣⠛⠁⠜")?; +#[test] +fn source_mixed_numbers_and_periodic_decimals_03() -> Result<()> { + return test_russian_braille(r#"0,4(71)"#, "⠼⠚⠂⠙⠣⠛⠁⠜"); +} - let expr = r#"538"#; - test_braille("Russian", expr, "⠼⠑⠼⠉⠦")?; +#[test] +fn source_mixed_numbers_and_periodic_decimals_04() -> Result<()> { + return test_russian_braille(r#"538"#, "⠼⠑⠼⠉⠦"); +} - let expr = r#"224+4-1524"#; - test_braille("Russian", expr, "⠼⠃⠐⠆⠼⠃⠙⠀⠖⠼⠙⠀⠤⠼⠁⠑⠀⠳⠼⠃⠙⠰")?; - return Ok(()); +#[test] +fn source_mixed_numbers_and_periodic_decimals_05() -> Result<()> { + return test_russian_braille(r#"224+4-1524"#, "⠼⠃⠐⠆⠼⠃⠙⠀⠖⠼⠙⠀⠤⠼⠁⠑⠀⠳⠼⠃⠙⠰"); } #[test] -fn latin_alphabet_indicators() -> Result<()> { - let expr = r#"x+A+y+B=x+y+A+B"#; - test_braille("Russian", expr, "⠠⠭⠀⠖⠨⠁⠀⠖⠠⠽⠀⠖⠨⠃⠀⠶⠠⠭⠀⠖⠽⠀⠖⠨⠁⠀⠖⠃")?; +fn latin_alphabet_indicators_01() -> Result<()> { + return test_russian_braille(r#"x+A+y+B=x+y+A+B"#, "⠠⠭⠀⠖⠨⠁⠀⠖⠠⠽⠀⠖⠨⠃⠀⠶⠠⠭⠀⠖⠽⠀⠖⠨⠁⠀⠖⠃"); +} - let expr = r#"MCDLXIV"#; - test_braille("Russian", expr, "⠨⠍⠉⠙⠇⠭⠊⠧")?; - return Ok(()); +#[test] +fn latin_alphabet_indicators_02() -> Result<()> { + return test_russian_braille(r#"MCDLXIV"#, "⠨⠍⠉⠙⠇⠭⠊⠧"); } #[test] -fn alphabet_indicators_after_numbers_and_greek() -> Result<()> { - let expr = r#"2x+15=23"#; - test_braille("Russian", expr, "⠼⠃⠄⠠⠭⠀⠖⠼⠁⠑⠀⠶⠼⠃⠉")?; +fn alphabet_indicators_after_numbers_and_greek_01() -> Result<()> { + return test_russian_braille(r#"2x+15=23"#, "⠼⠃⠄⠠⠭⠀⠖⠼⠁⠑⠀⠶⠼⠃⠉"); +} - let expr = r#"L=2πr"#; - test_braille("Russian", expr, "⠨⠇⠀⠶⠼⠃⠰⠏⠠⠗")?; +#[test] +fn alphabet_indicators_after_numbers_and_greek_02() -> Result<()> { + return test_russian_braille(r#"L=2πr"#, "⠨⠇⠀⠶⠼⠃⠰⠏⠠⠗"); +} - let expr = r#"α+β=Α+Β"#; - test_braille("Russian", expr, "⠰⠁⠀⠖⠃⠀⠶⠸⠁⠀⠖⠃")?; - return Ok(()); +#[test] +fn alphabet_indicators_after_numbers_and_greek_03() -> Result<()> { + return test_russian_braille(r#"α+β=Α+Β"#, "⠰⠁⠀⠖⠃⠀⠶⠸⠁⠀⠖⠃"); } #[test] -fn source_typeform_and_mathvariant_indicators() -> Result<()> { - let expr = r#"x"#; - test_braille("Russian", expr, "⠻⠠⠭⠻")?; +fn source_typeform_and_mathvariant_indicators_01() -> Result<()> { + return test_russian_braille(r#"x"#, "⠻⠠⠭⠻"); +} - let expr = r#"y"#; - test_braille("Russian", expr, "⠸⠠⠽⠸")?; +#[test] +fn source_typeform_and_mathvariant_indicators_02() -> Result<()> { + return test_russian_braille(r#"y"#, "⠸⠠⠽⠸"); +} - let expr = r#"z"#; - test_braille("Russian", expr, "⠻⠸⠠⠵⠸⠻")?; +#[test] +fn source_typeform_and_mathvariant_indicators_03() -> Result<()> { + return test_russian_braille(r#"z"#, "⠻⠸⠠⠵⠸⠻"); +} - let expr = r#"AB"#; - test_braille("Russian", expr, "⠻⠨⠁⠃⠻")?; +#[test] +fn source_typeform_and_mathvariant_indicators_04() -> Result<()> { + return test_russian_braille(r#"AB"#, "⠻⠨⠁⠃⠻"); +} - let expr = r#"x+y"#; - test_braille("Russian", expr, "⠻⠠⠭⠻⠀⠖⠽")?; +#[test] +fn source_typeform_and_mathvariant_indicators_05() -> Result<()> { + return test_russian_braille(r#"x+y"#, "⠻⠠⠭⠻⠀⠖⠽"); +} - let expr = r#"𝐱"#; - test_braille("Russian", expr, "⠻⠠⠭⠻")?; +#[test] +fn source_typeform_and_mathvariant_indicators_06() -> Result<()> { + return test_russian_braille(r#"𝐱"#, "⠻⠠⠭⠻"); +} - let expr = r#"𝑥"#; - test_braille("Russian", expr, "⠸⠠⠭⠸")?; +#[test] +fn source_typeform_and_mathvariant_indicators_07() -> Result<()> { + return test_russian_braille(r#"𝑥"#, "⠸⠠⠭⠸"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠻⠠⠭⠻")?; +#[test] +fn source_typeform_and_mathvariant_indicators_08() -> Result<()> { + return test_russian_braille(r#"x"#, "⠻⠠⠭⠻"); +} - let expr = r#"xy"#; - test_braille("Russian", expr, "⠻⠠⠭⠽⠻")?; +#[test] +fn source_typeform_and_mathvariant_indicators_09() -> Result<()> { + return test_russian_braille(r#"xy"#, "⠻⠠⠭⠽⠻"); +} - let expr = r#"y"#; - test_braille("Russian", expr, "⠸⠠⠽⠸")?; - return Ok(()); +#[test] +fn source_typeform_and_mathvariant_indicators_10() -> Result<()> { + return test_russian_braille(r#"y"#, "⠸⠠⠽⠸"); } #[test] -fn source_gost_58511_typeform_layout_indicators() -> Result<()> { - let expr = r#"xy"#; - test_braille("Russian", expr, "⠻⠠⠭⠽⠻")?; +fn source_gost_58511_typeform_layout_indicators_01() -> Result<()> { + return test_russian_braille(r#"xy"#, "⠻⠠⠭⠽⠻"); +} - let expr = r#"ab"#; - test_braille("Russian", expr, "⠸⠠⠁⠸⠸⠃⠸")?; +#[test] +fn source_gost_58511_typeform_layout_indicators_02() -> Result<()> { + return test_russian_braille(r#"ab"#, "⠸⠠⠁⠸⠸⠃⠸"); +} - let expr = r#"xy"#; - test_braille("Russian", expr, "⠻⠸⠠⠭⠽⠸⠻")?; +#[test] +fn source_gost_58511_typeform_layout_indicators_03() -> Result<()> { + return test_russian_braille(r#"xy"#, "⠻⠸⠠⠭⠽⠸⠻"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠸⠠⠭⠸")?; +#[test] +fn source_gost_58511_typeform_layout_indicators_04() -> Result<()> { + return test_russian_braille(r#"x"#, "⠸⠠⠭⠸"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠠⠭")?; +#[test] +fn source_gost_58511_typeform_layout_indicators_05() -> Result<()> { + return test_russian_braille(r#"x"#, "⠠⠭"); +} - let expr = r#"AB"#; - test_braille("Russian", expr, "⠨⠁⠀⠃")?; +#[test] +fn source_gost_58511_typeform_layout_indicators_06() -> Result<()> { + return test_russian_braille(r#"AB"#, "⠨⠁⠀⠃"); +} - let expr = r#"xприy"#; - test_braille("Russian", expr, "⠠⠭⠏⠗⠊⠽")?; - return Ok(()); +#[test] +fn source_gost_58511_typeform_layout_indicators_07() -> Result<()> { + return test_russian_braille(r#"xприy"#, "⠠⠭⠏⠗⠊⠽"); } #[test] fn wikipedia_times_divide() -> Result<()> { - let expr = r#"6×7:14=3"#; - test_braille("Russian", expr, "⠼⠋⠀⠦⠼⠛⠀⠲⠼⠁⠙⠀⠶⠼⠉")?; - return Ok(()); + return test_russian_braille(r#"6×7:14=3"#, "⠼⠋⠀⠦⠼⠛⠀⠲⠼⠁⠙⠀⠶⠼⠉"); } #[test] fn wikipedia_linear_parens() -> Result<()> { - let expr = r#"3·(97)=6"#; - test_braille("Russian", expr, "⠼⠉⠄⠣⠼⠊⠀⠤⠼⠛⠜⠀⠶⠼⠋")?; - return Ok(()); + return test_russian_braille(r#"3·(97)=6"#, "⠼⠉⠄⠣⠼⠊⠀⠤⠼⠛⠜⠀⠶⠼⠋"); } #[test] -fn wikipedia_sqrt() -> Result<()> { - let expr = r#"10000<101"#; - test_braille("Russian", expr, "⠩⠱⠼⠁⠚⠚⠚⠚⠹⠀⠪⠀⠼⠁⠚⠁")?; +fn wikipedia_sqrt_01() -> Result<()> { + return test_russian_braille(r#"10000<101"#, "⠩⠱⠼⠁⠚⠚⠚⠚⠹⠀⠪⠀⠼⠁⠚⠁"); +} - let expr = r#"ab"#; - test_braille("Russian", expr, "⠩⠱⠠⠁⠹⠄⠃")?; - return Ok(()); +#[test] +fn wikipedia_sqrt_02() -> Result<()> { + return test_russian_braille(r#"ab"#, "⠩⠱⠠⠁⠹⠄⠃"); } #[test] -fn source_functions_logs_derivatives() -> Result<()> { - let expr = r#"cosα"#; - test_braille("Russian", expr, "⠫⠉⠰⠁")?; +fn source_functions_logs_derivatives_01() -> Result<()> { + return test_russian_braille(r#"cosα"#, "⠫⠉⠰⠁"); +} - let expr = r#"tgxctgx=1"#; - test_braille("Russian", expr, "⠫⠞⠠⠭⠄⠫⠉⠞⠠⠭⠀⠶⠼⠁")?; +#[test] +fn source_functions_logs_derivatives_02() -> Result<()> { + return test_russian_braille(r#"tgxctgx=1"#, "⠫⠞⠠⠭⠄⠫⠉⠞⠠⠭⠀⠶⠼⠁"); +} - let expr = r#"sin2x"#; - test_braille("Russian", expr, "⠫⠎⠌⠆⠠⠭")?; +#[test] +fn source_functions_logs_derivatives_03() -> Result<()> { + return test_russian_braille(r#"sin2x"#, "⠫⠎⠌⠆⠠⠭"); +} - let expr = r#"tg3α+β2"#; - test_braille("Russian", expr, "⠫⠞⠌⠒⠐⠆⠰⠁⠀⠖⠃⠀⠳⠼⠃⠰")?; +#[test] +fn source_functions_logs_derivatives_04() -> Result<()> { + return test_russian_braille(r#"tg3α+β2"#, "⠫⠞⠌⠒⠐⠆⠰⠁⠀⠖⠃⠀⠳⠼⠃⠰"); +} - let expr = r#"(ctgβ)2m-n+3"#; - test_braille("Russian", expr, "⠣⠫⠉⠞⠰⠃⠜⠌⠼⠃⠠⠍⠀⠤⠝⠀⠖⠼⠉⠱")?; +#[test] +fn source_functions_logs_derivatives_05() -> Result<()> { + return test_russian_braille(r#"(ctgβ)2m-n+3"#, "⠣⠫⠉⠞⠰⠃⠜⠌⠼⠃⠠⠍⠀⠤⠝⠀⠖⠼⠉⠱"); +} - let expr = r#"arcsin2x"#; - test_braille("Russian", expr, "⠫⠁⠎⠌⠆⠠⠭")?; +#[test] +fn source_functions_logs_derivatives_06() -> Result<()> { + return test_russian_braille(r#"arcsin2x"#, "⠫⠁⠎⠌⠆⠠⠭"); +} - let expr = r#"arccosn+1x"#; - test_braille("Russian", expr, "⠫⠁⠉⠌⠠⠝⠀⠖⠼⠁⠱⠠⠭")?; +#[test] +fn source_functions_logs_derivatives_07() -> Result<()> { + return test_russian_braille(r#"arccosn+1x"#, "⠫⠁⠉⠌⠠⠝⠀⠖⠼⠁⠱⠠⠭"); +} - let expr = r#"arctg3x+y2"#; - test_braille("Russian", expr, "⠫⠁⠞⠌⠒⠐⠆⠠⠭⠀⠖⠽⠀⠳⠼⠃⠰")?; +#[test] +fn source_functions_logs_derivatives_08() -> Result<()> { + return test_russian_braille(r#"arctg3x+y2"#, "⠫⠁⠞⠌⠒⠐⠆⠠⠭⠀⠖⠽⠀⠳⠼⠃⠰"); +} - let expr = r#"tanx+cotx"#; - test_braille("Russian", expr, "⠫⠞⠠⠭⠀⠖⠫⠉⠞⠠⠭")?; +#[test] +fn source_functions_logs_derivatives_09() -> Result<()> { + return test_russian_braille(r#"tanx+cotx"#, "⠫⠞⠠⠭⠀⠖⠫⠉⠞⠠⠭"); +} - let expr = r#"logxylogyx=1"#; - test_braille("Russian", expr, "⠫⠇⠡⠠⠭⠱⠽⠄⠫⠇⠡⠠⠽⠱⠭⠀⠶⠼⠁")?; +#[test] +fn source_functions_logs_derivatives_10() -> Result<()> { + return test_russian_braille(r#"logxylogyx=1"#, "⠫⠇⠡⠠⠭⠱⠽⠄⠫⠇⠡⠠⠽⠱⠭⠀⠶⠼⠁"); +} - let expr = r#"shx+chx=sinhx+coshx"#; - test_braille("Russian", expr, "⠫⠎⠓⠠⠭⠀⠖⠫⠉⠓⠠⠭⠀⠶⠫⠎⠓⠠⠭⠀⠖⠫⠉⠓⠠⠭")?; +#[test] +fn source_functions_logs_derivatives_11() -> Result<()> { + return test_russian_braille(r#"shx+chx=sinhx+coshx"#, "⠫⠎⠓⠠⠭⠀⠖⠫⠉⠓⠠⠭⠀⠶⠫⠎⠓⠠⠭⠀⠖⠫⠉⠓⠠⠭"); +} - let expr = r#"thxcthx=1"#; - test_braille("Russian", expr, "⠫⠞⠓⠠⠭⠄⠫⠉⠞⠓⠠⠭⠀⠶⠼⠁")?; +#[test] +fn source_functions_logs_derivatives_12() -> Result<()> { + return test_russian_braille(r#"thxcthx=1"#, "⠫⠞⠓⠠⠭⠄⠫⠉⠞⠓⠠⠭⠀⠶⠼⠁"); +} - let expr = r#"argz=0,sgnx"#; - test_braille("Russian", expr, "⠫⠁⠗⠛⠠⠵⠀⠶⠼⠚⠠⠂⠫⠎⠛⠝⠠⠭")?; +#[test] +fn source_functions_logs_derivatives_13() -> Result<()> { + return test_russian_braille(r#"argz=0,sgnx"#, "⠫⠁⠗⠛⠠⠵⠀⠶⠼⠚⠠⠂⠫⠎⠛⠝⠠⠭"); +} - let expr = r#"detA+rankA=rgA"#; - test_braille("Russian", expr, "⠫⠙⠑⠞⠨⠁⠀⠖⠫⠗⠁⠝⠅⠨⠁⠀⠶⠫⠗⠛⠨⠁")?; +#[test] +fn source_functions_logs_derivatives_14() -> Result<()> { + return test_russian_braille(r#"detA+rankA=rgA"#, "⠫⠙⠑⠞⠨⠁⠀⠖⠫⠗⠁⠝⠅⠨⠁⠀⠶⠫⠗⠛⠨⠁"); +} - let expr = r#"Rez+Imz"#; - test_braille("Russian", expr, "⠫⠗⠑⠠⠵⠀⠖⠫⠊⠍⠠⠵")?; +#[test] +fn source_functions_logs_derivatives_15() -> Result<()> { + return test_russian_braille(r#"Rez+Imz"#, "⠫⠗⠑⠠⠵⠀⠖⠫⠊⠍⠠⠵"); +} - let expr = r#"gradφ+rotF+divF"#; - test_braille("Russian", expr, "⠫⠛⠗⠁⠙⠰⠋⠀⠖⠫⠗⠕⠞⠨⠋⠀⠖⠫⠙⠊⠧⠨⠋")?; +#[test] +fn source_functions_logs_derivatives_16() -> Result<()> { + return test_russian_braille(r#"gradφ+rotF+divF"#, "⠫⠛⠗⠁⠙⠰⠋⠀⠖⠫⠗⠕⠞⠨⠋⠀⠖⠫⠙⠊⠧⠨⠋"); +} - let expr = r#"gcd(a,b)=lcm(c,d)"#; - test_braille("Russian", expr, "⠫⠛⠉⠙⠣⠠⠁⠠⠂⠃⠜⠀⠶⠫⠇⠉⠍⠣⠠⠉⠠⠂⠙⠜")?; +#[test] +fn source_functions_logs_derivatives_17() -> Result<()> { + return test_russian_braille(r#"gcd(a,b)=lcm(c,d)"#, "⠫⠛⠉⠙⠣⠠⠁⠠⠂⠃⠜⠀⠶⠫⠇⠉⠍⠣⠠⠉⠠⠂⠙⠜"); +} - let expr = r#"y(x)=f(x)"#; - test_braille("Russian", expr, "⠠⠽⠔⠣⠭⠜⠀⠶⠋⠣⠭⠜")?; +#[test] +fn source_functions_logs_derivatives_18() -> Result<()> { + return test_russian_braille(r#"y(x)=f(x)"#, "⠠⠽⠔⠣⠭⠜⠀⠶⠋⠣⠭⠜"); +} - let expr = r#"y(x)=limxx0y(x)-y(x0)x-x0"#; - test_braille("Russian", expr, "⠠⠽⠔⠣⠭⠜⠀⠶⠫⠇⠍⠨⠡⠠⠭⠀⠒⠕⠭⠡⠴⠱⠆⠽⠣⠭⠜⠀⠤⠽⠣⠭⠡⠴⠜⠀⠳⠭⠀⠤⠭⠡⠴⠰")?; +#[test] +fn source_functions_logs_derivatives_19() -> Result<()> { + return test_russian_braille(r#"y(x)=limxx0y(x)-y(x0)x-x0"#, "⠠⠽⠔⠣⠭⠜⠀⠶⠫⠇⠍⠨⠡⠠⠭⠀⠒⠕⠭⠡⠴⠱⠆⠽⠣⠭⠜⠀⠤⠽⠣⠭⠡⠴⠜⠀⠳⠭⠀⠤⠭⠡⠴⠰"); +} - let expr = r#"xnaприn+"#; - test_braille("Russian", expr, "⠠⠭⠡⠝⠱⠀⠒⠕⠁⠀⠏⠗⠊⠀⠝⠀⠒⠕⠀⠖⠻")?; - return Ok(()); +#[test] +fn source_functions_logs_derivatives_20() -> Result<()> { + return test_russian_braille(r#"xnaприn+"#, "⠠⠭⠡⠝⠱⠀⠒⠕⠁⠀⠏⠗⠊⠀⠝⠀⠒⠕⠀⠖⠻"); } #[test] -fn source_large_operator_limits() -> Result<()> { - let expr = r#"14x2dx"#; - test_braille("Russian", expr, "⠮⠡⠂⠌⠲⠠⠭⠌⠆⠙⠭")?; +fn source_large_operator_limits_01() -> Result<()> { + return test_russian_braille(r#"14x2dx"#, "⠮⠡⠂⠌⠲⠠⠭⠌⠆⠙⠭"); +} - let expr = r#"i=1nai"#; - test_braille("Russian", expr, "⠸⠎⠨⠡⠠⠊⠀⠶⠼⠁⠱⠨⠌⠠⠝⠱⠁⠡⠊⠱")?; +#[test] +fn source_large_operator_limits_02() -> Result<()> { + return test_russian_braille(r#"i=1nai"#, "⠸⠎⠨⠡⠠⠊⠀⠶⠼⠁⠱⠨⠌⠠⠝⠱⠁⠡⠊⠱"); +} - let expr = r#"0nbk"#; - test_braille("Russian", expr, "⠸⠏⠡⠴⠌⠠⠝⠱⠃⠡⠅⠱")?; - return Ok(()); +#[test] +fn source_large_operator_limits_03() -> Result<()> { + return test_russian_braille(r#"0nbk"#, "⠸⠏⠡⠴⠌⠠⠝⠱⠃⠡⠅⠱"); } #[test] -fn source_geometry_matrix_chemistry() -> Result<()> { - let expr = r#"ABC=15°3012"#; - test_braille("Russian", expr, "⠸⠪⠨⠁⠃⠉⠀⠶⠼⠁⠑⠨⠴⠼⠉⠚⠨⠔⠼⠁⠃⠨⠔⠔")?; +fn source_geometry_matrix_chemistry_01() -> Result<()> { + return test_russian_braille(r#"ABC=15°3012"#, "⠸⠪⠨⠁⠃⠉⠀⠶⠼⠁⠑⠨⠴⠼⠉⠚⠨⠔⠼⠁⠃⠨⠔⠔"); +} - let expr = r#"ABC"#; - test_braille("Russian", expr, "⠸⠪⠨⠁⠔⠃⠔⠉⠔")?; +#[test] +fn source_geometry_matrix_chemistry_02() -> Result<()> { + return test_russian_braille(r#"ABC"#, "⠸⠪⠨⠁⠔⠃⠔⠉⠔"); +} - let expr = r#"A1B1C1"#; - test_braille("Russian", expr, "⠸⠙⠨⠁⠡⠂⠃⠡⠂⠉⠡⠂")?; +#[test] +fn source_geometry_matrix_chemistry_03() -> Result<()> { + return test_russian_braille(r#"A1B1C1"#, "⠸⠙⠨⠁⠡⠂⠃⠡⠂⠉⠡⠂"); +} - let expr = r#"2ABC"#; - test_braille("Russian", expr, "⠼⠃⠄⠸⠪⠨⠁⠃⠉")?; +#[test] +fn source_geometry_matrix_chemistry_04() -> Result<()> { + return test_russian_braille(r#"2ABC"#, "⠼⠃⠄⠸⠪⠨⠁⠃⠉"); +} - let expr = r#"3ABC"#; - test_braille("Russian", expr, "⠼⠉⠄⠸⠙⠨⠁⠃⠉")?; +#[test] +fn source_geometry_matrix_chemistry_05() -> Result<()> { + return test_russian_braille(r#"3ABC"#, "⠼⠉⠄⠸⠙⠨⠁⠃⠉"); +} - let expr = r#"4EF"#; - test_braille("Russian", expr, "⠼⠙⠄⠸⠜⠨⠑⠋")?; +#[test] +fn source_geometry_matrix_chemistry_06() -> Result<()> { + return test_russian_braille(r#"4EF"#, "⠼⠙⠄⠸⠜⠨⠑⠋"); +} - let expr = r#"KLMPQR"#; - test_braille("Russian", expr, "⠸⠙⠨⠅⠇⠍⠀⠢⠸⠙⠨⠏⠟⠗")?; +#[test] +fn source_geometry_matrix_chemistry_07() -> Result<()> { + return test_russian_braille(r#"KLMPQR"#, "⠸⠙⠨⠅⠇⠍⠀⠢⠸⠙⠨⠏⠟⠗"); +} - let expr = r#"ABCD"#; - test_braille("Russian", expr, "⠨⠁⠃⠸⠸⠨⠉⠙")?; +#[test] +fn source_geometry_matrix_chemistry_08() -> Result<()> { + return test_russian_braille(r#"ABCD"#, "⠨⠁⠃⠸⠸⠨⠉⠙"); +} - let expr = r#"ab"#; - test_braille("Russian", expr, "⠠⠁⠼⠄⠃")?; +#[test] +fn source_geometry_matrix_chemistry_09() -> Result<()> { + return test_russian_braille(r#"ab"#, "⠠⠁⠼⠄⠃"); +} - let expr = r#"ABCD"#; - test_braille("Russian", expr, "⠨⠁⠃⠼⠄⠉⠙")?; +#[test] +fn source_geometry_matrix_chemistry_10() -> Result<()> { + return test_russian_braille(r#"ABCD"#, "⠨⠁⠃⠼⠄⠉⠙"); +} - let expr = r#"a=2"#; - test_braille("Russian", expr, "⠠⠁⠒⠂⠀⠶⠼⠃")?; +#[test] +fn source_geometry_matrix_chemistry_11() -> Result<()> { + return test_russian_braille(r#"a=2"#, "⠠⠁⠒⠂⠀⠶⠼⠃"); +} - let expr = r#"AB+BC=AC"#; - test_braille("Russian", expr, "⠨⠁⠃⠨⠒⠂⠀⠖⠃⠉⠨⠒⠂⠀⠶⠁⠉⠨⠒⠂")?; +#[test] +fn source_geometry_matrix_chemistry_12() -> Result<()> { + return test_russian_braille(r#"AB+BC=AC"#, "⠨⠁⠃⠨⠒⠂⠀⠖⠃⠉⠨⠒⠂⠀⠶⠁⠉⠨⠒⠂"); +} - let expr = r#"KL¯=4PQ¯"#; - test_braille("Russian", expr, "⠨⠅⠇⠨⠒⠀⠶⠼⠙⠄⠨⠏⠟⠨⠒")?; +#[test] +fn source_geometry_matrix_chemistry_13() -> Result<()> { + return test_russian_braille(r#"KL¯=4PQ¯"#, "⠨⠅⠇⠨⠒⠀⠶⠼⠙⠄⠨⠏⠟⠨⠒"); +} - let expr = r#"ABCD"#; - test_braille("Russian", expr, "⠨⠁⠃⠨⠒⠂⠸⠸⠨⠉⠙⠨⠒⠂")?; +#[test] +fn source_geometry_matrix_chemistry_14() -> Result<()> { + return test_russian_braille(r#"ABCD"#, "⠨⠁⠃⠨⠒⠂⠸⠸⠨⠉⠙⠨⠒⠂"); +} - let expr = r#"EF=KL"#; - test_braille("Russian", expr, "⠸⠜⠨⠑⠋⠀⠶⠸⠜⠨⠅⠇")?; +#[test] +fn source_geometry_matrix_chemistry_15() -> Result<()> { + return test_russian_braille(r#"EF=KL"#, "⠸⠜⠨⠑⠋⠀⠶⠸⠜⠨⠅⠇"); +} - let expr = r#"ABCD"#; - test_braille("Russian", expr, "⠨⠁⠃⠨⠒⠂⠂⠸⠸⠨⠉⠙⠰⠨⠒⠂⠂")?; +#[test] +fn source_geometry_matrix_chemistry_16() -> Result<()> { + return test_russian_braille(r#"ABCD"#, "⠨⠁⠃⠨⠒⠂⠂⠸⠸⠨⠉⠙⠰⠨⠒⠂⠂"); +} - let expr = r#"AB"#; - test_braille("Russian", expr, "⠨⠁⠃⠨⠒⠂")?; +#[test] +fn source_geometry_matrix_chemistry_17() -> Result<()> { + return test_russian_braille(r#"AB"#, "⠨⠁⠃⠨⠒⠂"); +} - let expr = r#"AB¯"#; - test_braille("Russian", expr, "⠨⠁⠃⠨⠒")?; +#[test] +fn source_geometry_matrix_chemistry_18() -> Result<()> { + return test_russian_braille(r#"AB¯"#, "⠨⠁⠃⠨⠒"); +} - let expr = r#"AB"#; - test_braille("Russian", expr, "⠨⠁⠃⠨⠒⠂⠂")?; +#[test] +fn source_geometry_matrix_chemistry_19() -> Result<()> { + return test_russian_braille(r#"AB"#, "⠨⠁⠃⠨⠒⠂⠂"); +} - let expr = r#"AB=KL¯"#; - test_braille("Russian", expr, "⠨⠁⠃⠰⠨⠒⠂⠀⠶⠅⠇⠰⠨⠒")?; +#[test] +fn source_geometry_matrix_chemistry_20() -> Result<()> { + return test_russian_braille(r#"AB=KL¯"#, "⠨⠁⠃⠰⠨⠒⠂⠀⠶⠅⠇⠰⠨⠒"); +} - let expr = r#"(abcd)"#; - test_braille("Russian", expr, "⠣⠠⠁⠀⠃⠨⠳⠉⠀⠙⠜")?; +#[test] +fn source_geometry_matrix_chemistry_21() -> Result<()> { + return test_russian_braille(r#"(abcd)"#, "⠣⠠⠁⠀⠃⠨⠳⠉⠀⠙⠜"); +} - let expr = r#"{x+y+z=1x+2y+3z=2x+3y+2z=5"#; - test_braille("Russian", expr, "⠏⠀⠠⠭⠀⠖⠽⠀⠖⠵⠀⠶⠼⠁⠨⠳⠇⠀⠠⠭⠀⠖⠼⠃⠠⠽⠀⠖⠼⠉⠠⠵⠀⠶⠼⠃⠨⠳⠧⠀⠠⠭⠀⠖⠼⠉⠠⠽⠀⠖⠼⠃⠠⠵⠀⠶⠼⠑")?; +#[test] +fn source_geometry_matrix_chemistry_22() -> Result<()> { + return test_russian_braille(r#"{x+y+z=1x+2y+3z=2x+3y+2z=5"#, "⠏⠀⠠⠭⠀⠖⠽⠀⠖⠵⠀⠶⠼⠁⠨⠳⠇⠀⠠⠭⠀⠖⠼⠃⠠⠽⠀⠖⠼⠉⠠⠵⠀⠶⠼⠃⠨⠳⠧⠀⠠⠭⠀⠖⠼⠉⠠⠽⠀⠖⠼⠃⠠⠵⠀⠶⠼⠑"); +} - let expr = r#"1ваза-5цветов2ваза-3цветка3ваза-?цветов}"#; - test_braille("Russian", expr, "⠼⠁⠺⠁⠵⠁⠀⠤⠼⠑⠉⠺⠑⠞⠕⠺⠀⠹⠨⠳⠼⠃⠺⠁⠵⠁⠀⠤⠼⠉⠉⠺⠑⠞⠅⠁⠀⠸⠨⠳⠼⠉⠺⠁⠵⠁⠀⠤⠠⠢⠉⠺⠑⠞⠕⠺⠀⠼")?; +#[test] +fn source_geometry_matrix_chemistry_23() -> Result<()> { + return test_russian_braille(r#"1ваза-5цветов2ваза-3цветка3ваза-?цветов}"#, "⠼⠁⠺⠁⠵⠁⠀⠤⠼⠑⠉⠺⠑⠞⠕⠺⠀⠹⠨⠳⠼⠃⠺⠁⠵⠁⠀⠤⠼⠉⠉⠺⠑⠞⠅⠁⠀⠸⠨⠳⠼⠉⠺⠁⠵⠁⠀⠤⠠⠢⠉⠺⠑⠞⠕⠺⠀⠼"); +} - let expr = r#"x+y=72x+3y=17"#; - test_braille("Russian", expr, "⠠⠭⠀⠖⠽⠀⠶⠼⠛⠨⠳⠼⠃⠠⠭⠀⠖⠼⠉⠠⠽⠀⠶⠼⠁⠛")?; +#[test] +fn source_geometry_matrix_chemistry_24() -> Result<()> { + return test_russian_braille(r#"x+y=72x+3y=17"#, "⠠⠭⠀⠖⠽⠀⠶⠼⠛⠨⠳⠼⠃⠠⠭⠀⠖⠼⠉⠠⠽⠀⠶⠼⠁⠛"); +} - let expr = r#"f(x)={0x<0xx0"#; - test_braille("Russian", expr, "⠠⠋⠣⠭⠜⠀⠶⠏⠀⠼⠚⠀⠠⠭⠀⠪⠀⠼⠚⠨⠳⠧⠀⠠⠭⠀⠭⠀⠕⠶⠼⠚")?; +#[test] +fn source_geometry_matrix_chemistry_25() -> Result<()> { + return test_russian_braille(r#"f(x)={0x<0xx0"#, "⠠⠋⠣⠭⠜⠀⠶⠏⠀⠼⠚⠀⠠⠭⠀⠪⠀⠼⠚⠨⠳⠧⠀⠠⠭⠀⠭⠀⠕⠶⠼⠚"); +} - let expr = r#"|abcd|"#; - test_braille("Russian", expr, "⠸⠠⠁⠀⠃⠨⠳⠉⠀⠙⠸")?; +#[test] +fn source_geometry_matrix_chemistry_26() -> Result<()> { + return test_russian_braille(r#"|abcd|"#, "⠸⠠⠁⠀⠃⠨⠳⠉⠀⠙⠸"); +} - let expr = r#"H2O"#; - test_braille("Russian", expr, "⠨⠓⠡⠆⠕")?; +#[test] +fn source_geometry_matrix_chemistry_27() -> Result<()> { + return test_russian_braille(r#"H2O"#, "⠨⠓⠡⠆⠕"); +} - let expr = r#"H2C=CH2"#; - test_braille("Russian", expr, "⠨⠓⠡⠆⠉⠦⠉⠓⠡⠆")?; - return Ok(()); +#[test] +fn source_geometry_matrix_chemistry_28() -> Result<()> { + return test_russian_braille(r#"H2C=CH2"#, "⠨⠓⠡⠆⠉⠦⠉⠓⠡⠆"); } #[test] -fn source_label_marks() -> Result<()> { - let expr = r#"x~"#; - test_braille("Russian", expr, "⠠⠭⠢")?; +fn source_label_marks_01() -> Result<()> { + return test_russian_braille(r#"x~"#, "⠠⠭⠢"); +} - let expr = r#"7~"#; - test_braille("Russian", expr, "⠼⠛⠢")?; +#[test] +fn source_label_marks_02() -> Result<()> { + return test_russian_braille(r#"7~"#, "⠼⠛⠢"); +} - let expr = r#"x^"#; - test_braille("Russian", expr, "⠠⠭⠲")?; +#[test] +fn source_label_marks_03() -> Result<()> { + return test_russian_braille(r#"x^"#, "⠠⠭⠲"); +} - let expr = r#"xˇ"#; - test_braille("Russian", expr, "⠠⠭⠰⠔")?; +#[test] +fn source_label_marks_04() -> Result<()> { + return test_russian_braille(r#"xˇ"#, "⠠⠭⠰⠔"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠠⠭⠘⠆")?; +#[test] +fn source_label_marks_05() -> Result<()> { + return test_russian_braille(r#"x"#, "⠠⠭⠘⠆"); +} - let expr = r#"x?"#; - test_braille("Russian", expr, "⠠⠭⠘⠠⠢")?; +#[test] +fn source_label_marks_06() -> Result<()> { + return test_russian_braille(r#"x?"#, "⠠⠭⠘⠠⠢"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠠⠭⠘⠦⠶")?; +#[test] +fn source_label_marks_07() -> Result<()> { + return test_russian_braille(r#"x"#, "⠠⠭⠘⠦⠶"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠠⠭⠔")?; +#[test] +fn source_label_marks_08() -> Result<()> { + return test_russian_braille(r#"x"#, "⠠⠭⠔"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠠⠭⠨⠦⠶")?; +#[test] +fn source_label_marks_09() -> Result<()> { + return test_russian_braille(r#"x"#, "⠠⠭⠨⠦⠶"); +} - let expr = r#"x~"#; - test_braille("Russian", expr, "⠠⠭⠰⠢")?; +#[test] +fn source_label_marks_10() -> Result<()> { + return test_russian_braille(r#"x~"#, "⠠⠭⠰⠢"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠠⠭⠆")?; +#[test] +fn source_label_marks_11() -> Result<()> { + return test_russian_braille(r#"x"#, "⠠⠭⠆"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠠⠭⠨⠴")?; +#[test] +fn source_label_marks_12() -> Result<()> { + return test_russian_braille(r#"x"#, "⠠⠭⠨⠴"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠠⠭⠸⠶")?; +#[test] +fn source_label_marks_13() -> Result<()> { + return test_russian_braille(r#"x"#, "⠠⠭⠸⠶"); +} - let expr = r#"x×"#; - test_braille("Russian", expr, "⠠⠭⠸⠦")?; +#[test] +fn source_label_marks_14() -> Result<()> { + return test_russian_braille(r#"x×"#, "⠠⠭⠸⠦"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠠⠭⠆⠆")?; +#[test] +fn source_label_marks_15() -> Result<()> { + return test_russian_braille(r#"x"#, "⠠⠭⠆⠆"); +} - let expr = r#"x+y~"#; - test_braille("Russian", expr, "⠯⠠⠭⠀⠖⠽⠽⠢")?; +#[test] +fn source_label_marks_16() -> Result<()> { + return test_russian_braille(r#"x+y~"#, "⠯⠠⠭⠀⠖⠽⠽⠢"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠸⠶⠠⠭")?; +#[test] +fn source_label_marks_17() -> Result<()> { + return test_russian_braille(r#"x"#, "⠸⠶⠠⠭"); +} - let expr = r#"x"#; - test_braille("Russian", expr, "⠨⠆⠠⠭")?; +#[test] +fn source_label_marks_18() -> Result<()> { + return test_russian_braille(r#"x"#, "⠨⠆⠠⠭"); +} - let expr = r#"2x"#; - test_braille("Russian", expr, "⠼⠃⠐⠸⠆⠠⠭")?; +#[test] +fn source_label_marks_19() -> Result<()> { + return test_russian_braille(r#"2x"#, "⠼⠃⠐⠸⠆⠠⠭"); +} - let expr = r#"ax"#; - test_braille("Russian", expr, "⠠⠁⠐⠨⠶⠭")?; +#[test] +fn source_label_marks_20() -> Result<()> { + return test_russian_braille(r#"ax"#, "⠠⠁⠐⠨⠶⠭"); +} - let expr = r#"x1"#; - test_braille("Russian", expr, "⠸⠆⠠⠭⠡⠂")?; +#[test] +fn source_label_marks_21() -> Result<()> { + return test_russian_braille(r#"x1"#, "⠸⠆⠠⠭⠡⠂"); +} - let expr = r#"xn2"#; - test_braille("Russian", expr, "⠨⠦⠶⠠⠭⠡⠝⠱⠌⠆")?; +#[test] +fn source_label_marks_22() -> Result<()> { + return test_russian_braille(r#"xn2"#, "⠨⠦⠶⠠⠭⠡⠝⠱⠌⠆"); +} - let expr = r#"7i3?"#; - test_braille("Russian", expr, "⠸⠠⠢⠼⠛⠡⠠⠊⠱⠌⠒")?; +#[test] +fn source_label_marks_23() -> Result<()> { + return test_russian_braille(r#"7i3?"#, "⠸⠠⠢⠼⠛⠡⠠⠊⠱⠌⠒"); +} - let expr = r#"x~12"#; - test_braille("Russian", expr, "⠠⠭⠢⠡⠼⠁⠌⠼⠃⠱")?; - return Ok(()); +#[test] +fn source_label_marks_24() -> Result<()> { + return test_russian_braille(r#"x~12"#, "⠠⠭⠢⠡⠼⠁⠌⠼⠃⠱"); } #[test] -fn source_chemical_reactions_and_charges() -> Result<()> { - let expr = r#"2HCl+2Na2NaCl+H2"#; - test_braille("Russian", expr, "⠼⠃⠨⠓⠉⠠⠇⠀⠖⠼⠃⠨⠝⠠⠁⠀⠒⠕⠼⠃⠨⠝⠠⠁⠨⠉⠠⠇⠀⠖⠨⠓⠡⠆")?; +fn source_chemical_reactions_and_charges_01() -> Result<()> { + return test_russian_braille(r#"2HCl+2Na2NaCl+H2"#, "⠼⠃⠨⠓⠉⠠⠇⠀⠖⠼⠃⠨⠝⠠⠁⠀⠒⠕⠼⠃⠨⠝⠠⠁⠨⠉⠠⠇⠀⠖⠨⠓⠡⠆"); +} - let expr = r#"H2(g)+I2(g)2HI(g)"#; - test_braille("Russian", expr, "⠨⠓⠡⠆⠣⠠⠛⠜⠀⠖⠨⠊⠡⠆⠣⠠⠛⠜⠀⠒⠕⠀⠦⠶⠼⠃⠨⠓⠊⠣⠠⠛⠜")?; +#[test] +fn source_chemical_reactions_and_charges_02() -> Result<()> { + return test_russian_braille(r#"H2(g)+I2(g)2HI(g)"#, "⠨⠓⠡⠆⠣⠠⠛⠜⠀⠖⠨⠊⠡⠆⠣⠠⠛⠜⠀⠒⠕⠀⠦⠶⠼⠃⠨⠓⠊⠣⠠⠛⠜"); +} - let expr = r#"2Al2Al3++6e-"#; - test_braille("Russian", expr, "⠼⠃⠨⠁⠠⠇⠀⠒⠕⠼⠃⠨⠁⠠⠇⠌⠒⠖⠀⠖⠼⠋⠠⠑⠌⠤")?; +#[test] +fn source_chemical_reactions_and_charges_03() -> Result<()> { + return test_russian_braille(r#"2Al2Al3++6e-"#, "⠼⠃⠨⠁⠠⠇⠀⠒⠕⠼⠃⠨⠁⠠⠇⠌⠒⠖⠀⠖⠼⠋⠠⠑⠌⠤"); +} - let expr = r#"SO42-"#; - test_braille("Russian", expr, "⠨⠎⠕⠡⠲⠌⠆⠤")?; +#[test] +fn source_chemical_reactions_and_charges_04() -> Result<()> { + return test_russian_braille(r#"SO42-"#, "⠨⠎⠕⠡⠲⠌⠆⠤"); +} - let expr = r#"HPO4--"#; - test_braille("Russian", expr, "⠨⠓⠏⠕⠡⠲⠌⠆⠤")?; +#[test] +fn source_chemical_reactions_and_charges_05() -> Result<()> { + return test_russian_braille(r#"HPO4--"#, "⠨⠓⠏⠕⠡⠲⠌⠆⠤"); +} - let expr = r#"CNO"#; - test_braille("Russian", expr, "⠸⠉⠝⠕")?; +#[test] +fn source_chemical_reactions_and_charges_06() -> Result<()> { + return test_russian_braille(r#"CNO"#, "⠸⠉⠝⠕"); +} - let expr = r#"N300N"#; - test_braille("Russian", expr, "⠨⠝⠀⠒⠕⠨⠌⠼⠉⠚⠚⠱⠨⠝")?; +#[test] +fn source_chemical_reactions_and_charges_07() -> Result<()> { + return test_russian_braille(r#"N300N"#, "⠨⠝⠀⠒⠕⠨⠌⠼⠉⠚⠚⠱⠨⠝"); +} - let expr = r#"N300N"#; - test_braille("Russian", expr, "⠨⠝⠀⠒⠕⠨⠡⠼⠉⠚⠚⠱⠨⠝")?; +#[test] +fn source_chemical_reactions_and_charges_08() -> Result<()> { + return test_russian_braille(r#"N300N"#, "⠨⠝⠀⠒⠕⠨⠡⠼⠉⠚⠚⠱⠨⠝"); +} - let expr = r#"N300PtN"#; - test_braille("Russian", expr, "⠨⠝⠀⠒⠕⠨⠡⠼⠉⠚⠚⠱⠨⠌⠨⠏⠠⠞⠱⠨⠝")?; +#[test] +fn source_chemical_reactions_and_charges_09() -> Result<()> { + return test_russian_braille(r#"N300PtN"#, "⠨⠝⠀⠒⠕⠨⠡⠼⠉⠚⠚⠱⠨⠌⠨⠏⠠⠞⠱⠨⠝"); +} - let expr = r#"NaCl(aq)+H(l)+C(s)"#; - test_braille("Russian", expr, "⠨⠝⠠⠁⠨⠉⠠⠇⠣⠁⠟⠜⠀⠖⠨⠓⠣⠠⠇⠜⠀⠖⠨⠉⠣⠠⠎⠜")?; +#[test] +fn source_chemical_reactions_and_charges_10() -> Result<()> { + return test_russian_braille(r#"NaCl(aq)+H(l)+C(s)"#, "⠨⠝⠠⠁⠨⠉⠠⠇⠣⠁⠟⠜⠀⠖⠨⠓⠣⠠⠇⠜⠀⠖⠨⠉⠣⠠⠎⠜"); +} - let expr = r#"e++e--"#; - test_braille("Russian", expr, "⠠⠑⠌⠖⠀⠖⠑⠌⠆⠤")?; - return Ok(()); +#[test] +fn source_chemical_reactions_and_charges_11() -> Result<()> { + return test_russian_braille(r#"e++e--"#, "⠠⠑⠌⠖⠀⠖⠑⠌⠆⠤"); } #[test] -fn source_gost_logic_arrows() -> Result<()> { - let expr = r#"AB"#; - test_braille("Russian", expr, "⠨⠁⠀⠶⠜⠃")?; +fn source_gost_logic_arrows_01() -> Result<()> { + return test_russian_braille(r#"AB"#, "⠨⠁⠀⠶⠜⠃"); +} - let expr = r#"BA"#; - test_braille("Russian", expr, "⠨⠃⠀⠦⠶⠁")?; +#[test] +fn source_gost_logic_arrows_02() -> Result<()> { + return test_russian_braille(r#"BA"#, "⠨⠃⠀⠦⠶⠁"); +} - let expr = r#"CD"#; - test_braille("Russian", expr, "⠨⠉⠀⠦⠶⠜⠙")?; +#[test] +fn source_gost_logic_arrows_03() -> Result<()> { + return test_russian_braille(r#"CD"#, "⠨⠉⠀⠦⠶⠜⠙"); +} - let expr = r#"x:P(x)"#; - test_braille("Russian", expr, "⠫⠄⠠⠭⠀⠲⠨⠏⠣⠠⠭⠜")?; +#[test] +fn source_gost_logic_arrows_04() -> Result<()> { + return test_russian_braille(r#"x:P(x)"#, "⠫⠄⠠⠭⠀⠲⠨⠏⠣⠠⠭⠜"); +} - let expr = r#"x:P(x)"#; - test_braille("Russian", expr, "⠫⠢⠠⠭⠀⠲⠨⠏⠣⠠⠭⠜")?; - return Ok(()); +#[test] +fn source_gost_logic_arrows_05() -> Result<()> { + return test_russian_braille(r#"x:P(x)"#, "⠫⠢⠠⠭⠀⠲⠨⠏⠣⠠⠭⠜"); } #[test] -fn source_less_common_math_symbols() -> Result<()> { - let expr = r#"3±2"#; - test_braille("Russian", expr, "⠼⠉⠀⠖⠤⠼⠃")?; +fn source_less_common_math_symbols_01() -> Result<()> { + return test_russian_braille(r#"3±2"#, "⠼⠉⠀⠖⠤⠼⠃"); +} - let expr = r#"xy"#; - test_braille("Russian", expr, "⠠⠭⠀⠢⠢⠽")?; +#[test] +fn source_less_common_math_symbols_02() -> Result<()> { + return test_russian_braille(r#"xy"#, "⠠⠭⠀⠢⠢⠽"); +} - let expr = r#"ab"#; - test_braille("Russian", expr, "⠠⠁⠀⠾⠃")?; +#[test] +fn source_less_common_math_symbols_03() -> Result<()> { + return test_russian_braille(r#"ab"#, "⠠⠁⠀⠾⠃"); +} - let expr = r#"x1y"#; - test_braille("Russian", expr, "⠠⠭⠀⠪⠶⠼⠁⠀⠪⠶⠠⠽")?; +#[test] +fn source_less_common_math_symbols_04() -> Result<()> { + return test_russian_braille(r#"x1y"#, "⠠⠭⠀⠪⠶⠼⠁⠀⠪⠶⠠⠽"); +} - let expr = r#"y0"#; - test_braille("Russian", expr, "⠠⠽⠀⠕⠶⠼⠚")?; +#[test] +fn source_less_common_math_symbols_05() -> Result<()> { + return test_russian_braille(r#"y0"#, "⠠⠽⠀⠕⠶⠼⠚"); +} - let expr = r#"AB"#; - test_braille("Russian", expr, "⠨⠁⠀⠠⠡⠀⠃")?; +#[test] +fn source_less_common_math_symbols_06() -> Result<()> { + return test_russian_braille(r#"AB"#, "⠨⠁⠀⠠⠡⠀⠃"); +} - let expr = r#"BA"#; - test_braille("Russian", expr, "⠨⠃⠀⠈⠌⠀⠁")?; +#[test] +fn source_less_common_math_symbols_07() -> Result<()> { + return test_russian_braille(r#"BA"#, "⠨⠃⠀⠈⠌⠀⠁"); +} - let expr = r#"f/x"#; - test_braille("Russian", expr, "⠹⠠⠋⠠⠌⠹⠭")?; +#[test] +fn source_less_common_math_symbols_08() -> Result<()> { + return test_russian_braille(r#"f/x"#, "⠹⠠⠋⠠⠌⠹⠭"); +} - let expr = r#"f"#; - test_braille("Russian", expr, "⠫⠴⠠⠋")?; +#[test] +fn source_less_common_math_symbols_09() -> Result<()> { + return test_russian_braille(r#"f"#, "⠫⠴⠠⠋"); +} - let expr = r#"ab"#; - test_braille("Russian", expr, "⠠⠁⠸⠃")?; +#[test] +fn source_less_common_math_symbols_10() -> Result<()> { + return test_russian_braille(r#"ab"#, "⠠⠁⠸⠃"); +} - let expr = r#"ab"#; - test_braille("Russian", expr, "⠠⠁⠀⠼⠀⠃")?; - return Ok(()); +#[test] +fn source_less_common_math_symbols_11() -> Result<()> { + return test_russian_braille(r#"ab"#, "⠠⠁⠀⠼⠀⠃"); }