// UEB tests for the basic mathml tags // These are additional tests from other sources // Those labeled with "aph_" come from the APH lessons: // https://uebmath.aphtech.org/ use crate::common::*; // Extra tests targeted at special cases in MathCAT #[test] fn overscript_grouping_aph_5_4_8() { // this test was added because #220 (failed to add grouping around overscript) let expr = " MN "; test_braille("UEB", expr, "⠰⠰⠣⠠⠠⠍⠝⠜⠨⠔⠳⠺⠗⠕"); } #[test] fn word_symbol_aph_6_7_5() { // this test was added because ≟ (U+225F) uses a 'G1 Word mode' char, so is different than others let expr = "4+512"; test_braille("UEB", expr, "⠼⠙⠐⠖⠼⠑⠀⠰⠰⠦⠻⠐⠶⠀⠼⠁⠃"); } #[test] fn blank_aph_7_1_ex5() { // this test was added because #153 (both the blank and spaces around "::") let expr = "3:15 :: 60:_"; test_braille("UEB", expr, "⠼⠉⠒⠼⠁⠑⠀⠒⠒⠀⠼⠋⠚⠒⠨⠤"); } #[test] fn word_symbol_aph_10_3_11() { // this test was added because ⊻ (U+22bb) uses a 'G1 Word mode' char, so is different than others let expr = " p q "; test_braille("UEB", expr, "⠰⠰⠏⠈⠖⠠⠱⠟"); } // Extra tests targeted at special cases in MathCAT #[test] fn number_space_before() { let expr = " 2"; test_braille("UEB", expr, "⠀⠼⠃"); } #[test] fn number_space_after() { let expr = "2 "; test_braille("UEB", expr, "⠼⠃⠀"); } #[test] fn number_space_before_and_after() { let expr = " 2 "; test_braille("UEB", expr, "⠀⠼⠃⠀"); } #[test] fn not_number_space_blocks() { // https://github.com/NSoiffer/MathCAT/issues/144 let expr = "123 ⁣456"; test_braille("UEB", expr, "⠼⠁⠃⠉⠀⠼⠙⠑⠋"); } #[test] fn dot_above_bug_204() { // https://github.com/NSoiffer/MathCAT/issues/204 let expr = " 0. 6 · "; test_braille("UEB", expr, "⠼⠚⠲⠣⠼⠋⠜⠘⠲"); } #[test] fn tilde_prefix_bug_244() { // https://github.com/NSoiffer/MathCAT/issues/244 let expr = " ~ p "; test_braille("UEB", expr, "⠈⠔⠏"); } #[test] fn double_tilde_prefix_bug_244() { // This is a a MathJax encoding of a double tilde -- see test Nemeth::tilde_137_3_mathjax let expr = " ~~ p "; test_braille("UEB", expr, "⠈⠔⠈⠔⠏"); } #[test] fn space_hack_between_digits() { // https://github.com/NSoiffer/MathCAT/issues/144 let expr = "1 ⁣3 ⁣5"; test_braille("UEB", expr, "⠼⠁⠀⠼⠉⠀⠼⠑"); } #[test] fn space_hack_around_operator() { // https://github.com/NSoiffer/MathCAT/issues/144 let expr = "y ⁣= ⁣5"; test_braille("UEB", expr, "⠰⠽⠀⠐⠶⠀⠼⠑"); } #[test] fn forced_g1_symbol_mode() { // A forced G1 should not count against starting in G2 mode // This is issue #170 -- surprisingly not tested by other tests let expr = "3x2dx"; test_braille("UEB", expr, "⠰⠮⠼⠉⠭⠔⠼⠃⠰⠙⠭"); } // extra tests targeted at contractions based on function names #[test] fn contractions_1() { let expr = " sechx+ coshy+ arccost "; // Note: "arccos" does not use the "cc" contraction -- RUEB 10.6.5 lists "arccosine" without the contraction test_braille("UEB", expr, "⠎⠑⠡⠀⠭⠐⠖⠉⠕⠩⠀⠽⠐⠖⠜⠉⠉⠕⠎⠀⠰⠞"); } #[test] fn contractions_2() { let expr = "kerh"; test_braille("UEB", expr, "⠅⠻⠀⠰⠓"); } #[test] fn contractions_3() { let expr = "argument(f)"; test_braille("UEB", expr, "⠜⠛⠥⠰⠞⠐⠣⠋⠐⠜"); } #[test] fn contractions_4() { let expr = "error function erf"; test_braille("UEB", expr, "⠻⠗⠕⠗⠀⠋⠥⠝⠉⠰⠝⠀⠻⠋"); } #[test] fn contractions_5() { let expr = "Real(z)"; test_braille("UEB", expr, "⠠⠗⠂⠇⠐⠣⠵⠐⠜"); } #[test] fn caps_bug_279() { let expr = "ABB"; test_braille("UEB", expr, "⠰⠰⠷⠠⠠⠁⠃⠨⠌⠠⠃⠾"); } #[test] fn caps_bug_295() { let expr = "PQ+ QR= RS+ QR "; test_braille("UEB", expr, "⠠⠠⠠⠏⠟⠐⠖⠟⠗⠀⠐⠶⠀⠗⠎⠐⠖⠟⠗⠠⠄"); }