// Nemeth tests for the basic mathml tags // The numbering refers to the Nemeth green book in most cases. // The newer NFB lessons include NFB (https://nfb.org/programs-services/braille-certification/mathematics-braille-transcribing) // These lessons are still being developed, so it is possible the numbering gets changed from that used here. use crate::common::*; #[test] fn num_indicator_9_a_1() { let expr = "27"; test_braille("Nemeth", expr, "⠼⠆⠶"); } #[test] fn num_indicator_9_a_4() { let expr = "y=2sinx"; test_braille("Nemeth", expr, "⠽⠀⠨⠅⠀⠼⠆⠎⠊⠝⠀⠭"); } #[test] fn num_indicator_9_a_5() { let expr = "sin1"; test_braille("Nemeth", expr, "⠎⠊⠝⠀⠼⠂"); } #[test] fn num_indicator_9_a_9() { let expr = "1"; test_braille("Nemeth", expr, "⠫⠪⠀⠼⠂"); } #[test] fn num_indicator_9_a_14() { let expr = "-1"; test_braille("Nemeth", expr, "⠤⠼⠂"); } #[test] fn num_indicator_9_a_15() { let expr = "-.3"; test_braille("Nemeth", expr, "⠤⠼⠨⠒"); } #[test] fn test_9_b_1() { let expr = "3 dogs"; test_braille("Nemeth", expr, "⠦⠼⠒⠀⠙⠕⠛⠎⠴"); } #[test] fn test_9_b_1_mtext() { let expr = "“3 dogs”"; test_braille("Nemeth", expr, "⠦⠼⠒⠀⠙⠕⠛⠎⠴"); } #[test] fn test_9_b_4() { let expr = "-4"; test_braille("Nemeth", expr, "⠦⠤⠼⠲"); } #[test] fn test_9_c_1_linear() { // see https://github.com/NSoiffer/MathCAT/issues/43 for discussion on linear layout let expr = "| 12 -3-4 |"; test_braille("Nemeth", expr, "⠠⠳⠼⠂⠀⠼⠆⠀⣍⠤⠒⠀⠤⠼⠲⠠⠳"); } #[test] fn num_indicator_9_d_2() { let expr = "3#4"; test_braille("Nemeth", expr, "⠼⠒⠨⠼⠼⠲"); } #[test] fn num_indicator_9_d_3() { let expr = "34"; test_braille("Nemeth", expr, "⠼⠒⠈⠼⠼⠲"); } #[test] fn num_indicator_9_e_2() { let expr = "0"; test_braille("Nemeth", expr, "⠸⠼⠴"); } #[test] fn num_indicator_9_e_5() { let expr = "𝟒𝟑56"; test_braille("Nemeth", expr, "⠸⠼⠲⠒⠼⠢⠖"); } #[test] fn num_indicator_9_e_6() { let expr = ""; test_braille("Nemeth", expr, "⠫⠉⠸⠫⠼⠢⠻"); } #[test] fn num_indicator_9_f_1() { // shortened to the math part (1-1) -- "correspondence" should probably be text and involves contractions let expr = "1-to-1"; test_braille("Nemeth", expr, "⠼⠂⠤⠞⠕⠤⠼⠂"); } #[test] fn non_list_10_4() { let expr = "(1,2,and 3)"; test_braille("Nemeth", expr, "⠷⠂⠠⠀⠼⠆⠠⠀⠁⠝⠙⠀⠼⠒⠾"); } #[test] fn list_10_6_1() { let expr = "1,i,1,i"; test_braille("Nemeth", expr, "⠼⠂⠠⠀⠰⠊⠠⠀⠤⠼⠂⠠⠀⠤⠊"); } #[test] fn list_10_6_8() { let expr = " [ 1°,sin1° ] "; test_braille("Nemeth", expr, "⠈⠷⠫⠪⠀⠼⠂⠘⠨⠡⠠⠀⠎⠊⠝⠀⠼⠂⠘⠨⠡⠐⠈⠾"); } #[test] fn list_10_6_11() { let expr = "( x=1,2,,10 )"; test_braille("Nemeth", expr, "⠷⠭⠀⠨⠅⠀⠼⠂⠠⠀⠼⠆⠠⠀⠄⠄⠄⠠⠀⠼⠂⠴⠾"); } #[test] fn list_10_6_14() { let expr = "1,2,3"; test_braille("Nemeth", expr, "⠷⠂⠠⠀⠆⠠⠀⠒⠾"); } #[test] fn list_num_ind_11_a_1() { let expr = "[0,1]"; test_braille("Nemeth", expr, "⠈⠷⠴⠠⠀⠂⠈⠾"); } #[test] fn list_num_ind_11_a_2() { let expr = "(-1,-2,-3)"; test_braille("Nemeth", expr, "⠷⠤⠂⠠⠀⠤⠆⠠⠀⠤⠒⠾"); } #[test] fn list_num_ind__11_a_3() { let expr = "(1+h,2+k,0)"; test_braille("Nemeth", expr, "⠷⠂⠬⠓⠠⠀⠆⠬⠅⠠⠀⠴⠾"); } #[test] fn list_num_ind__11_a_4() { let expr = "0,1,±2"; test_braille("Nemeth", expr, "⠷⠴⠠⠀⠤⠂⠠⠀⠬⠤⠆⠾"); } #[test] fn list_num_ind_11_a_5() { let expr = " 2sin30° , 3cos60° "; test_braille("Nemeth", expr, "⠷⠆⠎⠊⠝⠀⠼⠒⠴⠘⠨⠡⠠⠀⠒⠉⠕⠎⠀⠼⠖⠴⠘⠨⠡⠐⠾"); } #[test] fn lesson_11_35_1() { // this is about using a numeric indicator inside an enclosed list after an angle let expr = "(1,2,3)"; test_braille("Nemeth", expr, "⠷⠫⠪⠀⠼⠂⠠⠀⠫⠪⠀⠼⠆⠠⠀⠫⠪⠀⠼⠒⠾"); } #[test] fn list_num_ind_11_a_7() { let expr = "(x,7,8,y)"; test_braille("Nemeth", expr, "⠷⠭⠠⠀⠶⠠⠀⠸⠼⠦⠠⠀⠽⠾"); } #[test] fn list_num_ind_11_c_1() { let expr = "π=3.14159 26535"; test_braille("Nemeth", expr, "⠨⠏⠀⠨⠅⠀⠼⠒⠨⠂⠲⠂⠢⠔⠀⠆⠖⠢⠒⠢⠀⠄⠄⠄"); } #[test] fn list_num_ind_11_d_1() { let expr = "65-75"; test_braille("Nemeth", expr, "⠼⠖⠢⠤⠶⠢"); } #[test] fn list_num_ind_11_d_2() { let expr = "3:304:45"; test_braille("Nemeth", expr, "⠼⠒⠸⠒⠼⠒⠴⠤⠲⠸⠒⠼⠲⠢"); } #[test] fn no_num_ind_11_e_3() { let expr = "r5"; test_braille("Nemeth", expr, "⠗⠐⠢"); } #[test] fn cap_roman_numeral_18_a_3() { let expr = "VII+V=XII"; test_braille("Nemeth", expr, "⠠⠠⠧⠊⠊⠬⠠⠧⠀⠨⠅⠀⠠⠠⠭⠊⠊"); } #[test] fn lower_roman_numeral_18_b_4() { let expr = "vi+iv=x"; test_braille("Nemeth", expr, "⠧⠊⠬⠊⠧⠀⠨⠅⠀⠭"); } #[test] fn cap_22_a_1() { // from WIRIS let expr = " ABC"; test_braille("Nemeth", expr, "⠫⠞⠀⠠⠁⠠⠃⠠⠉"); } #[test] fn greek_24_a_1() { let expr = "α"; test_braille("Nemeth", expr, "⠨⠁"); } #[test] fn german_24_a_7() { let expr = "𝔄"; test_braille("Nemeth", expr, "⠸⠠⠁"); } #[test] fn hebrew_24_a_8() { let expr = "0"; test_braille("Nemeth", expr, "⠠⠠⠁⠴"); } #[test] fn russian_24_a_10() { let expr = "А"; test_braille("Nemeth", expr, "⠈⠈⠠⠁"); } #[test] fn greek_24_b_1_together() { let expr = "αβ"; test_braille("Nemeth", expr, "⠨⠁⠨⠃"); } #[test] fn greek_24_b_1() { let expr = "αβ"; test_braille("Nemeth", expr, "⠨⠁⠨⠃"); } #[test] fn eli_nemeth_UEB_rule_book_4_11_1() { let expr = " p  D  z  R  x,  “y”  “w S”  “x”+“y” "; test_braille("Nemeth", expr, "⠰⠏⠀⠰⠠⠙⠀⠰⠵⠀⠰⠠⠗⠀⠰⠭⠠⠀⠦⠰⠽⠸⠴⠀⠦⠰⠺⠀⠰⠠⠎⠸⠴⠀⠦⠰⠭⠸⠴⠬⠸⠦⠰⠽⠸⠴"); } #[test] fn letter_26_b_18() { let expr = "(p and q)"; // Note: NFB lessons now say 'don't use contractions in Nemeth' -- example modified test_braille("Nemeth", expr, "⠷⠰⠏⠀⠁⠝⠙⠀⠰⠟⠾"); } #[test] fn letter_26_b_19() { let expr = "( l, m, n, are in set  R )"; // Note: NFB lessons now say 'don't use contractions in Nemeth' -- example modified (no contraction for "re" and "in") // This likely would use an escape to UEB for the "are in set" under the new rules test_braille("Nemeth", expr, "⠷⠰⠇⠠⠀⠰⠍⠠⠀⠰⠝⠠⠀⠁⠗⠑⠀⠊⠝⠀⠎⠑⠞⠀⠰⠠⠗⠾"); } #[test] fn boldface_32_b_3() { let expr = "345"; test_braille("Nemeth", expr, "⠸⠼⠒⠲⠢"); } #[test] fn boldface_32_b_6() { let expr = "𝟒35"; test_braille("Nemeth", expr, "⠸⠼⠲⠼⠒⠢"); } #[test] fn punct_37_1_1() { let expr = " 12 , 34 . "; test_braille("Nemeth", expr, "⠹⠂⠌⠆⠼⠠⠀⠹⠒⠌⠲⠼⠸⠲"); } #[test] fn punct_37_1_2() { let expr = " velocity _ . "; test_braille("Nemeth", expr, "⠐⠧⠑⠇⠕⠉⠊⠞⠽⠣⠱⠻⠸⠲"); } #[test] fn punct_37_2_2() { let expr = " 49 "; test_braille("Nemeth", expr, "⠦⠼⠲⠔⠸⠴"); } #[test] fn punct_37_3_1() { let expr = "I,II,III."; test_braille("Nemeth", expr, "⠰⠠⠊⠠⠀⠠⠠⠊⠊⠠⠀⠠⠠⠊⠊⠊⠸⠲"); } #[test] fn punct_37_4_2() { let expr = "1,3,."; test_braille("Nemeth", expr, "⠼⠂⠠⠀⠼⠒⠠⠀⠄⠄⠄⠸⠲"); } #[test] fn punct_37_6_1() { let expr = "5×3=?."; test_braille("Nemeth", expr, "⠼⠢⠈⠡⠒⠀⠨⠅⠀⠿⠸⠲"); } #[test] fn punct_37_7_1() { let expr = "a,b,c."; test_braille("Nemeth", expr, "⠰⠁⠠⠀⠰⠃⠠⠀⠰⠉⠸⠲"); } #[test] fn punct_37_8_1() { let expr = "ABC."; test_braille("Nemeth", expr, "⠫⠞⠀⠠⠁⠠⠃⠠⠉⠸⠲"); } #[test] fn punct_37_11_1() { let expr = "x¯."; test_braille("Nemeth", expr, "⠭⠱⠸⠲"); } #[test] fn punct_37_16_1() { let expr = "100%."; test_braille("Nemeth", expr, "⠼⠂⠴⠴⠈⠴⠸⠲"); } #[test] fn punct_37_17_1() { let expr = "0,"; test_braille("Nemeth", expr, "⠼⠴⠠⠸⠴"); } #[test] fn punct_38_1_2() { let expr = "49"; // Corrected: the green book has the quote mark encoded as if the character was a double quote (”), but this seems like a typo test_braille("Nemeth", expr, "⠴⠠⠼⠲⠔"); } #[test] fn punct_38_4_12() { let expr = "rate×time."; test_braille("Nemeth", expr, "⠗⠁⠞⠑⠈⠡⠞⠊⠍⠑⠲"); } #[test] fn punct_38_6_1() { let expr = "0,1,2"; test_braille("Nemeth", expr, "⠼⠴⠠⠀⠼⠂⠠⠀⠼⠆"); } #[test] fn punct_38_6_3() { let expr = "(1),(2),(3)."; test_braille("Nemeth", expr, "⠷⠂⠾⠠⠀⠷⠆⠾⠠⠀⠷⠒⠾⠸⠲"); } #[test] fn colon_40_1() { // including 'intent' is a little bit of a cheat, but there is no way to know whether this is time or ratio without it let expr = "3:30"; test_braille("Nemeth", expr, "⠼⠒⠸⠒⠼⠒⠴"); } #[test] fn colon_40_1_mtext() { let expr = "3:30"; test_braille("Nemeth", expr, "⠼⠒⠸⠒⠼⠒⠴"); } #[test] fn colon_40_2() { let expr = "f:(x,y)"; test_braille("Nemeth", expr, "⠰⠋⠸⠒⠷⠭⠠⠀⠽⠾"); } #[test] fn dash_42_4() { let expr = "15=23"; test_braille("Nemeth", expr, "⠹⠤⠤⠤⠤⠀⠌⠂⠢⠼⠀⠨⠅⠀⠹⠆⠌⠒⠼"); } #[test] fn dash_42_6() { let expr = "$2+$3=$"; test_braille("Nemeth", expr, "⠈⠎⠆⠬⠈⠎⠒⠀⠨⠅⠀⠈⠎⠤⠤⠤⠤"); } #[test] fn ellipsis_43_a_1() { let expr = "1,3,5,,15."; test_braille("Nemeth", expr, "⠼⠂⠠⠀⠼⠒⠠⠀⠼⠢⠠⠀⠄⠄⠄⠠⠀⠼⠂⠢⠸⠲"); } #[test] fn ellipsis_43_b_3() { let expr = " p1α1 prαr "; test_braille("Nemeth", expr, "⠏⠂⠘⠨⠁⠘⠰⠂⠐⠄⠄⠄⠀⠏⠰⠗⠘⠨⠁⠘⠰⠗"); } #[test] fn ellipsis_43_b_4() { let expr = "(,-1,0,1,)"; test_braille("Nemeth", expr, "⠷⠄⠄⠄⠠⠀⠤⠂⠠⠀⠴⠠⠀⠂⠠⠀⠄⠄⠄⠾"); } #[test] fn ellipsis_43_b_5() { let expr = "12¢+14¢=¢"; test_braille("Nemeth", expr, "⠼⠂⠆⠈⠉⠬⠂⠲⠈⠉⠀⠨⠅⠀⠄⠄⠄⠈⠉"); } #[test] fn omission_57_1() { let expr = "(?)3=27"; test_braille("Nemeth", expr, "⠷⠿⠾⠘⠒⠀⠨⠅⠀⠼⠆⠶"); } #[test] fn omission_57_3() { let expr = " 7×2?14"; test_braille("Nemeth", expr, "⠼⠶⠈⠡⠆⠀⠿⠀⠼⠂⠲"); } #[test] fn omission_57_4() { let expr = "?+?=10"; test_braille("Nemeth", expr, "⠿⠬⠿⠀⠨⠅⠀⠼⠂⠴"); } #[test] fn omission_57_5() { let expr = "7-?=5"; test_braille("Nemeth", expr, "⠼⠶⠤⠿⠀⠨⠅⠀⠼⠢"); } #[test] fn omission_57_6() { let expr = "9-5=-?-"; test_braille("Nemeth", expr, "⠼⠔⠤⠢⠀⠨⠅⠀⠿"); } #[test] fn omission_57_7() { // test uses a couple of different forms of blank spaces let expr = " (5,)+ (  ,15)= (7,13) "; test_braille("Nemeth", expr, "⠷⠢⠠⠀⠿⠾⠬⠷⠿⠠⠀⠂⠢⠾⠀⠨⠅⠀⠷⠶⠠⠀⠂⠒⠾"); } #[test] fn omission_57_8() { let expr = "5×25="; test_braille("Nemeth", expr, "⠼⠢⠈⠡⠆⠢⠀⠨⠅⠀⠿"); } #[test] fn simple_frac_62_a_3() { let expr = "a+bc"; test_braille("Nemeth", expr, "⠹⠁⠬⠃⠌⠉⠼"); } #[test] fn beveled_frac_62_b_1() { let expr = " a+b c+d "; test_braille("Nemeth", expr, "⠹⠁⠬⠃⠸⠌⠉⠬⠙⠼"); } #[test] fn mixed_frac_63_a_1() { let expr = "438"; test_braille("Nemeth", expr, "⠼⠲⠸⠹⠒⠌⠦⠸⠼"); } #[test] fn mixed_frac_64_2() { let expr = "43/8"; test_braille("Nemeth", expr, "⠼⠲⠸⠹⠒⠸⠌⠦⠸⠼"); } #[test] fn complex_frac_66_1() { let expr = "385"; test_braille("Nemeth", expr, "⠠⠹⠹⠒⠌⠦⠼⠠⠌⠢⠠⠼"); } #[test] fn non_hyper_complex_frac_67_1() { let expr = "ab 34 56 "; test_braille("Nemeth", expr, "⠹⠁⠌⠃⠘⠠⠹⠹⠒⠌⠲⠼⠠⠌⠹⠢⠌⠖⠼⠠⠼⠐⠼"); } #[test] fn hyper_complex_frac_68_a_1() { // book uses 2d layout -- linear is used here let expr = " 114 135 5 "; test_braille("Nemeth", expr, "⠠⠠⠹⠠⠹⠂⠸⠹⠂⠌⠲⠸⠼⠠⠌⠂⠸⠹⠒⠌⠢⠸⠼⠠⠼⠠⠠⠌⠢⠠⠠⠼"); } #[test] fn nested_sup_74_b_1() { let expr = "nxy"; test_braille("Nemeth", expr, "⠝⠘⠭⠘⠘⠽"); } #[test] fn nested_sup_mmultiscripts_74_b_1() { let expr = "nxy"; test_braille("Nemeth", expr, "⠝⠘⠭⠘⠘⠽"); } #[test] fn nested_sup_74_b_4() { let expr = "nxy"; test_braille("Nemeth", expr, "⠝⠰⠭⠰⠰⠽"); } #[test] fn nested_sub_sup_74_c_5() { let expr = "nxaj"; test_braille("Nemeth", expr, "⠝⠘⠭⠘⠰⠁⠘⠰⠰⠚"); } #[test] fn as_multiscript_nested_sub_sup_74_c_5() { let expr = "nxaj"; test_braille("Nemeth", expr, "⠝⠘⠭⠘⠰⠁⠘⠰⠰⠚"); } #[test] fn left_sup_75_1() { let expr = "nx"; test_braille("Nemeth", expr, "⠘⠭⠐⠝"); } #[test] fn left_sup_75_4() { let expr = "nyx"; test_braille("Nemeth", expr, "⠰⠭⠐⠝⠰⠽"); } #[test] fn left_sup_75_7() { let expr = "x na "; test_braille("Nemeth", expr, "⠘⠰⠁⠘⠝⠐⠭"); } #[test] fn left_sup_75_8() { let expr = "xna"; test_braille("Nemeth", expr, "⠰⠝⠰⠘⠁⠐⠭"); } #[test] fn left_sup_75_12() { let expr = "pbxc"; test_braille("Nemeth", expr, "⠏⠘⠃⠘⠉⠐⠭"); } #[test] fn german_base_77_4_3() { let expr = " 𝔄 1 "; test_braille("Nemeth", expr, "⠸⠠⠁⠂"); } #[test] fn prime_77_4_4() { let expr = " x' 1 "; test_braille("Nemeth", expr, "⠭⠄⠂"); } #[test] fn prescript_77_4_6() { let expr = " x 3"; test_braille("Nemeth", expr, "⠰⠒⠐⠭"); } #[test] fn prescript_77_4_7() { let expr = "xi1"; test_braille("Nemeth", expr, "⠭⠰⠊⠰⠰⠂"); } #[test] fn log_77_4_8() { let expr = "log2 x"; test_braille("Nemeth", expr, "⠇⠕⠛⠆⠀⠭"); } #[test] fn mmultiscripts_77_4_10() { // not right to use msub because the subscripts should be aligned -- nested msub's won't align subscripts -- mmultiscripts solves this let expr = " ( C O 3 ) 2 "; test_braille("Nemeth", expr, "⠷⠠⠉⠠⠕⠒⠾⠰⠆"); } #[test] fn word_77_4_12() { let expr = "seven3"; test_braille("Nemeth", expr, "⠎⠑⠧⠑⠝⠰⠒"); } #[test] fn prescript_77_4_18() { // from MathJaX let expr = "3x1"; test_braille("Nemeth", expr, "⠰⠒⠐⠭⠂"); } #[test] fn mmultiscripts_77_4_18() { // from WIRIS (changed empty mrow to 'none') let expr = "x13"; test_braille("Nemeth", expr, "⠰⠒⠐⠭⠂"); } #[test] fn comma_number_77_4_20() { // mathml from mathjax output for "x_{10,000}" let expr = "x10,000"; test_braille("Nemeth", expr, "⠭⠂⠴⠠⠴⠴⠴"); } #[test] fn sum_77_4_23() { let expr = "0nak"; test_braille("Nemeth", expr, "⠨⠠⠎⠴⠘⠝⠐⠁⠰⠅"); } #[test] fn product_77_4_24() { let expr = "0nak"; test_braille("Nemeth", expr, "⠨⠠⠏⠴⠘⠝⠐⠁⠰⠅"); } #[test] fn integral_77_4_26() { let expr = " 0 1-x2 f(x)dx "; test_braille("Nemeth", expr, "⠮⠰⠴⠘⠜⠂⠤⠭⠘⠘⠆⠘⠻⠐⠋⠷⠭⠾⠙⠭"); } #[test] fn comma_space_78_1() { // WIRIS output when typed with spaces (which I doubt people do) let expr = "x i, j, k"; test_braille("Nemeth", expr, "⠭⠰⠊⠪⠚⠪⠅"); } #[test] fn comma_78_2() { let expr = "x(a,b)"; test_braille("Nemeth", expr, "⠭⠰⠷⠁⠪⠃⠾"); } #[test] fn comma_78_2_invisible() { // test with invisible comma -- should be the same (issue #40) let expr = "x(ab)"; test_braille("Nemeth", expr, "⠭⠰⠷⠁⠪⠃⠾"); } #[test] fn comma_78_3() { let expr = "x1,2"; test_braille("Nemeth", expr, "⠭⠰⠂⠪⠆"); } #[test] fn comma_78_6() { // WIRIS output when typed with spaces let expr = "(x, y)"; test_braille("Nemeth", expr, "⠷⠭⠠⠀⠽⠾"); } #[test] fn nested_super_79_a_2() { let expr = "xa+y2"; test_braille("Nemeth", expr, "⠭⠰⠁⠐⠬⠽⠘⠆"); } #[test] fn nested_super_79_a_3() { let expr = "ex22"; test_braille("Nemeth", expr, "⠹⠑⠘⠭⠘⠘⠆⠐⠌⠆⠼"); } #[test] fn punctuation_after_sup_79_b_2() { let expr = "x2,x3"; test_braille("Nemeth", expr, "⠭⠘⠆⠠⠀⠭⠘⠒"); } #[test] fn comma_in_number_in_sup_79_b_3() { // bad mn from Wiris let expr = "x10,000"; test_braille("Nemeth", expr, "⠭⠘⠂⠴⠠⠴⠴⠴"); } #[test] fn comma_in_sup_79_b_4() { let expr = "xi,j"; test_braille("Nemeth", expr, "⠭⠰⠊⠪⠚"); } #[test] fn comma_ellipsis_in_sub_79_b_5() { let expr = " P n1 , n2 , "; test_braille("Nemeth", expr, "⠠⠏⠰⠝⠰⠰⠂⠰⠪⠝⠰⠰⠆⠰⠪⠀⠄⠄⠄"); } #[test] fn text_after_sup_79_c_3() { // bad mn from Wiris; also &A0; let expr = "6.696×108 mph"; test_braille("Nemeth", expr, "⠼⠖⠨⠖⠔⠖⠈⠡⠂⠴⠘⠦⠀⠍⠏⠓"); } #[test] fn table_entry_after_sup_79_c_4() { let expr = "( x2 y2 )"; test_braille("Nemeth", expr, "⠷⠭⠘⠆⠀⠽⠘⠆⠐⠾"); } #[test] fn nested_super_space_79_d_3() { let expr = "cos2x"; test_braille("Nemeth", expr, "⠉⠕⠎⠘⠆⠀⠭"); } #[test] fn nested_super_space_79_d_7() { let expr = "ecos2x"; test_braille("Nemeth", expr, "⠑⠘⠉⠕⠎⠘⠘⠆⠀⠭"); } #[test] fn nested_sup_sup_space_79_d_9() { let expr = "qlogqa"; test_braille("Nemeth", expr, "⠟⠘⠇⠕⠛⠘⠰⠟⠀⠁"); } #[test] fn whitespace_in_sup_79_e_1() { let expr = "e3.14159 26535"; test_braille("Nemeth", expr, "⠑⠘⠒⠨⠂⠲⠂⠢⠔⠀⠆⠖⠢⠒⠢"); } #[test] fn ellipsis_level_79_f_1() { let expr = "x 1+1/2+1/3+ +1/n"; test_braille("Nemeth", expr, "⠭⠘⠂⠬⠂⠸⠌⠆⠬⠂⠸⠌⠒⠬⠀⠄⠄⠄⠀⠬⠂⠸⠌⠝"); } #[test] fn comparison_79_g_2() { let expr = "2x<3x"; test_braille("Nemeth", expr, "⠼⠆⠘⠭⠀⠐⠅⠀⠼⠒⠘⠭"); } #[test] fn sub_ind_79_g_4() { let expr = "u=a"; test_braille("Nemeth", expr, "⠮⠰⠥⠀⠰⠨⠅⠀⠁"); } #[test] fn baseline_80_a_1() { let expr = "x2+y2"; test_braille("Nemeth", expr, "⠜⠭⠘⠆⠐⠬⠽⠘⠆⠐⠻"); } #[test] fn superscript_80_a_2() { let expr = "ex2+y2"; test_braille("Nemeth", expr, "⠑⠘⠜⠭⠘⠘⠆⠘⠬⠽⠘⠘⠆⠘⠻"); } #[test] fn sub_ind_80_b_3() { let expr = "P1Q2"; test_braille("Nemeth", expr, "⠠⠏⠂⠰⠆⠐⠠⠟"); } #[test] fn sub_ind_mmultiscripts_80_b_3() { let expr = "P1 Q2"; test_braille("Nemeth", expr, "⠠⠏⠂⠰⠆⠐⠠⠟"); } #[test] fn sub_ind_80_b_4() { let expr = "Ax~+y~"; test_braille("Nemeth", expr, "⠠⠁⠰⠐⠭⠣⠈⠱⠻⠬⠰⠐⠽⠣⠈⠱⠻"); } #[test] fn numeric_sub_81_a_1() { let expr = "(x1+1)"; test_braille("Nemeth", expr, "⠷⠭⠂⠬⠂⠾"); } #[test] fn msubsup_82_a_1() { let expr = "xan"; test_braille("Nemeth", expr, "⠭⠰⠁⠘⠝"); } #[test] fn msubsup_82_a_3() { let expr = "x12"; test_braille("Nemeth", expr, "⠭⠂⠘⠆"); } #[test] fn mmultiscripts_82_a_1() { let expr = "xan"; test_braille("Nemeth", expr, "⠭⠰⠁⠘⠝"); } #[test] fn mmultiscripts_82_a_2() { let expr = "xan"; test_braille("Nemeth", expr, "⠰⠁⠘⠝⠐⠭"); } #[test] fn mmultiscripts_82_a_3() { let expr = "x12"; test_braille("Nemeth", expr, "⠭⠂⠘⠆"); } #[test] fn sub_sup_82_b_1() { let expr = "anm"; test_braille("Nemeth", expr, "⠁⠘⠝⠐⠰⠍"); } #[test] fn mmultiscripts_82_b_1() { let expr = "anm"; test_braille("Nemeth", expr, "⠁⠘⠝⠐⠰⠍"); } #[test] fn sub_sup_82_b_2() { let expr = "amn"; test_braille("Nemeth", expr, "⠁⠰⠍⠐⠘⠝"); } #[test] fn mmultiscripts_82_b_2() { let expr = "amn"; test_braille("Nemeth", expr, "⠁⠰⠍⠐⠘⠝"); } #[test] fn mmultiscripts_82_b_3() { let expr = "xab"; test_braille("Nemeth", expr, "⠘⠁⠐⠰⠃⠐⠭"); } #[test] fn mmultiscripts_82_b_4() { let expr = "xba"; test_braille("Nemeth", expr, "⠰⠃⠐⠘⠁⠐⠭"); } #[test] fn mmultiscripts_82_b_5() { let expr = "x12"; test_braille("Nemeth", expr, "⠭⠂⠐⠘⠆"); } #[test] fn mmultiscripts_82_b_6() { let expr = "xa'b"; test_braille("Nemeth", expr, "⠭⠄⠰⠁⠐⠘⠃"); } #[test] fn prime_83_b_1() { let expr = "xa'"; test_braille("Nemeth", expr, "⠭⠄⠰⠁"); } #[test] fn prime_mmultiscripts_83_b_2() { let expr = " x ' 2"; test_braille("Nemeth", expr, "⠭⠄⠘⠆"); } #[test] fn prime_mathjax_83_b_2() { // from MathJax with input x^{\prime 2} let expr = " x' 2"; test_braille("Nemeth", expr, "⠭⠄⠘⠆"); } #[test] fn prime_wiris_83_b_2() { let expr = "x 2 "; test_braille("Nemeth", expr, "⠭⠄⠘⠆"); } #[test] fn prime_83_b_3() { let expr = " x ' ab"; test_braille("Nemeth", expr, "⠭⠄⠰⠁⠘⠃"); } #[test] fn prime_83_b_4() { let expr = " x'' 1 3"; test_braille("Nemeth", expr, "⠭⠄⠄⠂⠘⠒"); } #[test] fn prime_mmultiscripts_83_b_4() { let expr = " x '' 13"; test_braille("Nemeth", expr, "⠭⠄⠄⠂⠘⠒"); } #[test] fn prime_83_b_5() { let expr = " x ' *"; test_braille("Nemeth", expr, "⠭⠄⠘⠈⠼"); } #[test] fn prime_83_b_6() { let expr = " x * ' "; test_braille("Nemeth", expr, "⠭⠘⠈⠼⠄"); } #[test] fn prime_83_b_7() { let expr = " A ue "; test_braille("Nemeth", expr, "⠠⠁⠰⠥⠑⠘⠈⠼⠄"); } #[test] fn prime_83_b_8() { let expr = " A ue "; test_braille("Nemeth", expr, "⠠⠁⠄⠰⠥⠑⠘⠈⠼"); } #[test] fn underbar_86_a_1() { // Note: NFB lessons added a contracted form (lesson 12.5.1.b) let expr = "x¯"; test_braille("Nemeth", expr, "⠭⠩⠱"); } #[test] fn menclose_86_a_1() { // Note: NFB lessons added a contracted form (lesson 12.5.1.b) let expr = "x"; test_braille("Nemeth", expr, "⠭⠩⠱"); } #[test] fn lim_86_a_3() { let expr = "limx0f(x)"; test_braille("Nemeth", expr, "⠐⠇⠊⠍⠩⠭⠀⠫⠕⠀⠼⠴⠻⠀⠋⠷⠭⠾"); } #[test] fn overbar_86_a_4() { let expr = "x2¯"; test_braille("Nemeth", expr, "⠐⠭⠘⠆⠐⠣⠱⠻"); } #[test] fn menclose_86_a_4() { let expr = "x2"; test_braille("Nemeth", expr, "⠐⠭⠘⠆⠐⠣⠱⠻"); } #[test] fn overbar_86_a_5() { let expr = "x2¯"; test_braille("Nemeth", expr, "⠐⠭⠘⠆⠐⠣⠱⠻"); } #[test] fn mathml_spec_example_86_a() { let expr = " (_ ab ) "; test_braille("Nemeth", expr, "⠐⠷⠩⠱⠻⠹⠁⠌⠃⠼⠐⠾⠣⠱⠻"); } #[test] fn mathml_spec_example_alt_char_86_a() { let expr = " ( ab ) "; test_braille("Nemeth", expr, "⠐⠷⠩⠱⠻⠹⠁⠌⠃⠼⠐⠾⠣⠱⠻"); } #[test] fn menclose_lesson_12_5_5_5() { // this is what WIRIS exports let expr = "A(sn)"; test_braille("Nemeth", expr, "⠠⠁⠷⠎⠩⠱⠝⠾"); } #[test] fn munder_lesson_12_5_5_5() { let expr = "A(s¯n)"; test_braille("Nemeth", expr, "⠠⠁⠷⠎⠩⠱⠝⠾"); } #[test] fn overbar_86_b_1() { let expr = "x¯"; test_braille("Nemeth", expr, "⠭⠱"); } #[test] fn menclose_86_b_1() { let expr = "x"; test_braille("Nemeth", expr, "⠭⠱"); } #[test] fn overbar_86_b_2() { let expr = " x+y ¯ "; test_braille("Nemeth", expr, "⠐⠭⠬⠽⠣⠱⠻"); } #[test] fn primed_86_b_6() { let expr = "x¯"; test_braille("Nemeth", expr, "⠭⠱⠄"); } #[test] fn menclose_primed_86_b_6() { let expr = "x"; test_braille("Nemeth", expr, "⠭⠱⠄"); } #[test] fn overbar_86_b_10() { let expr = "3.54¯"; test_braille("Nemeth", expr, "⠼⠒⠨⠢⠲⠱"); } #[test] fn overbar_86_b_11() { let expr = " a¯A+ b¯B ¯"; test_braille("Nemeth", expr, "⠐⠷⠁⠱⠸⠰⠠⠁⠬⠃⠱⠸⠰⠠⠃⠾⠣⠱⠻"); } #[test] fn menclose_86_b_11() { let expr = " aA+ bB "; test_braille("Nemeth", expr, "⠐⠷⠁⠱⠸⠰⠠⠁⠬⠃⠱⠸⠰⠠⠃⠾⠣⠱⠻"); } #[test] fn order2_overbar_87_a_1() { let expr = " x+y ¯a=3 "; // this is a possible other interpretation of 87a(1), but I think the above is the right one // let expr = " // x+y¯ // a=3 // "; test_braille("Nemeth", expr, "⠐⠭⠬⠽⠣⠱⠣⠣⠁⠀⠨⠅⠀⠼⠒⠻"); } #[test] fn bar_above_and_below_88_1() { let expr = " x+y ¯ ¯ "; test_braille("Nemeth", expr, "⠐⠭⠬⠽⠩⠱⠣⠱⠻"); } #[test] fn above_and_below_88_2() { let expr = "n=1 12n=1"; test_braille("Nemeth", expr, "⠐⠨⠠⠎⠩⠝⠀⠨⠅⠀⠼⠂⠣⠠⠿⠻⠹⠂⠌⠆⠘⠝⠐⠼⠀⠨⠅⠀⠼⠂"); } #[test] fn menclose_top_bottom_88_1() { let expr = "x+y"; test_braille("Nemeth", expr, "⠐⠭⠬⠽⠩⠱⠣⠱⠻"); } #[test] fn binomial_90_1() { let expr = "(nk)"; test_braille("Nemeth", expr, "⠷⠝⠩⠅⠾"); } #[test] fn binomial_90_1_mtable() { // intent name not finalized -- may change let expr = " ( n k ) "; test_braille("Nemeth", expr, "⠷⠝⠩⠅⠾"); } #[test] fn modifier_in_script_91_1() { let expr = "Ax~"; test_braille("Nemeth", expr, "⠠⠁⠰⠐⠭⠣⠈⠱⠻"); } #[test] fn arrow_96_1() { let expr = " A B "; test_braille("Nemeth", expr, "⠐⠠⠁⠠⠃⠣⠫⠕⠻"); } #[test] fn arrow_96_10() { let expr = " X f g Y "; test_braille("Nemeth", expr, "⠠⠭⠀⠐⠫⠒⠒⠕⠣⠋⠨⠡⠛⠻⠀⠠⠽"); } #[test] fn bar_97_b_1() { let expr = ".3¯"; test_braille("Nemeth", expr, "⠼⠨⠒⠱"); } #[test] fn menclose_bar_97_b_1() { let expr = ".3"; test_braille("Nemeth", expr, "⠼⠨⠒⠱"); } #[test] fn menclose_bar_97_b_3() { let expr = "3.5729¯"; test_braille("Nemeth", expr, "⠼⠒⠨⠢⠶⠐⠆⠔⠣⠱⠻"); } #[test] fn carrot_98_1() { let expr = "x^"; test_braille("Nemeth", expr, "⠐⠭⠣⠸⠣⠻"); } #[test] fn dots_99_a_1() { let expr = ".3˙"; test_braille("Nemeth", expr, "⠼⠨⠐⠒⠣⠡⠻"); } #[test] fn dots_99_a_2() { let expr = ".1˙3˙5˙"; test_braille("Nemeth", expr, "⠼⠨⠐⠂⠒⠢⠣⠡⠻"); } #[test] fn dots_99_a_3() { let expr = ".135˙"; test_braille("Nemeth", expr, "⠼⠨⠂⠒⠐⠢⠣⠡⠻"); } #[test] fn ring_dot_100_1() { let expr = ""; test_braille("Nemeth", expr, "⠐⠨⠅⠣⠨⠡⠻"); } #[test] fn question_mark_over_equals_101_1() { let expr = "=?"; test_braille("Nemeth", expr, "⠐⠨⠅⠣⠸⠦⠻"); } #[test] fn question_mark_under_equals_101_2() { let expr = "=?"; test_braille("Nemeth", expr, "⠐⠨⠅⠩⠸⠦⠻"); } #[test] fn sqrt_103_a_2() { let expr = "x+y"; test_braille("Nemeth", expr, "⠜⠭⠬⠽⠻"); } #[test] fn sqrt_103_a_4() { let expr = " x2 + y2 "; test_braille("Nemeth", expr, "⠜⠭⠘⠆⠐⠬⠽⠘⠆⠐⠻"); } #[test] fn sqrt_103_b_2() { let expr = "(x+y)"; test_braille("Nemeth", expr, "⠜⠷⠭⠬⠽⠾"); } #[test] fn root_104_iii_1() { let expr = "23"; test_braille("Nemeth", expr, "⠣⠒⠜⠆⠻"); } #[test] fn root_104_iii_4() { let expr = " p+q m+n "; test_braille("Nemeth", expr, "⠣⠍⠬⠝⠜⠏⠬⠟⠻"); } #[test] fn nested_sqrt_105_1() { let expr = "x+ x+y +z"; test_braille("Nemeth", expr, "⠜⠭⠬⠨⠜⠭⠬⠽⠨⠻⠬⠵⠻"); } #[test] fn nested_root_105_2() { let expr = " x2 + x 2 + y 2 3 + y 2 3 "; test_braille("Nemeth", expr, "⠣⠒⠜⠭⠘⠆⠐⠬⠨⠣⠒⠜⠭⠘⠆⠐⠬⠽⠘⠆⠐⠨⠻⠬⠽⠘⠆⠐⠻"); } #[test] fn nested_sqrt_105_3() { let expr = " x3 = x 3 "; test_braille("Nemeth", expr, "⠜⠨⠣⠒⠜⠭⠨⠻⠻⠀⠨⠅⠀⠣⠒⠜⠨⠜⠭⠨⠻⠻"); } #[test] fn nested_sqrt_105_4() { let expr = " x+y+z "; test_braille("Nemeth", expr, "⠜⠭⠬⠨⠜⠽⠬⠨⠨⠜⠵⠨⠨⠻⠨⠻⠻"); } #[test] fn menclose_111_a_4() { let expr = "30°"; test_braille("Nemeth", expr, "⠫⠪⠸⠫⠼⠒⠴⠘⠨⠡⠐⠻"); } #[test] fn menclose_111_a_1() { let expr = "A"; test_braille("Nemeth", expr, "⠫⠉⠸⠫⠠⠁⠻"); } #[test] fn shape_115_a_1() { let expr = "1"; test_braille("Nemeth", expr, "⠫⠪⠀⠼⠂"); } #[test] fn shape_115_a_3() { let expr = "R"; test_braille("Nemeth", expr, "⠫⠉⠀⠠⠗"); } #[test] fn shape_115_a_6() { let expr = "A"; test_braille("Nemeth", expr, "⠫⠪⠨⠗⠻⠀⠠⠁"); } #[test] fn shape_115_a_11() { let expr = "mABC"; test_braille("Nemeth", expr, "⠍⠫⠪⠀⠠⠁⠠⠃⠠⠉"); } #[test] fn function_space_119_c_3() { // this depends upon a canonicalization to get the degree sign into a superscript position let expr = "sin30°cos45° +cos30°sin45°"; test_braille("Nemeth", expr, "⠎⠊⠝⠀⠼⠒⠴⠘⠨⠡⠐⠉⠕⠎⠀⠼⠲⠢⠘⠨⠡⠐⠬⠉⠕⠎⠀⠼⠒⠴⠘⠨⠡⠐⠎⠊⠝⠀⠼⠲⠢⠘⠨⠡"); } #[test] fn brace_above_121_1() { let expr = "x+y"; test_braille("Nemeth", expr, "⠐⠭⠬⠽⠣⠨⠷⠻"); } #[test] fn brace_below_121_2() { let expr = "x+y"; test_braille("Nemeth", expr, "⠐⠭⠬⠽⠩⠨⠾⠻"); } #[test] fn bracket_above_121_3() { let expr = "x+y"; test_braille("Nemeth", expr, "⠐⠭⠬⠽⠣⠈⠷⠻"); } #[test] fn racket_below_121_4() { let expr = "x+y"; test_braille("Nemeth", expr, "⠐⠭⠬⠽⠩⠈⠾⠻"); } #[test] fn identity_matrix_126_linearize() { // see https://github.com/NSoiffer/MathCAT/issues/43 for discussion on linear layout let expr = " ( 100 010 001 )"; // Note: braille pattern is just a guess as to how to linearize a matrix test_braille("Nemeth", expr, "⠠⠷⠼⠂⠀⠼⠴⠀⠼⠴⠀⣍⠴⠀⠼⠂⠀⠼⠴⠀⣍⠴⠀⠼⠴⠀⠼⠂⠠⠾"); } #[test] fn multipurpose_134_1() { let expr = "+2-+3"; test_braille("Nemeth", expr, "⠬⠆⠤⠐⠬⠒"); } #[test] fn plus_minus_134_4() { let expr = "x±y"; test_braille("Nemeth", expr, "⠭⠬⠤⠽"); } #[test] fn multipurpose_lesson_5_2_3() { let expr = "10+-5"; test_braille("Nemeth", expr, "⠼⠂⠴⠬⠐⠤⠢"); } #[test] fn multipurpose_lesson_5_2_4() { let expr = "10-+5"; test_braille("Nemeth", expr, "⠼⠂⠴⠤⠐⠬⠢"); } #[test] fn multipurpose_lesson_5_2_5() { let expr = "10--5"; test_braille("Nemeth", expr, "⠼⠂⠴⠤⠐⠤⠢"); } #[test] fn tilde_137_2() { let expr = "pqr"; test_braille("Nemeth", expr, "⠈⠱⠏⠈⠬⠈⠱⠟⠈⠬⠈⠱⠗"); } #[test] fn tilde_137_3() { let expr = "~~TR"; test_braille("Nemeth", expr, "⠈⠱⠐⠈⠱⠠⠞⠈⠬⠠⠗"); } #[test] fn tilde_137_3_mathjax() { let expr = "∼∼TR"; test_braille("Nemeth", expr, "⠈⠱⠐⠈⠱⠠⠞⠈⠬⠠⠗"); } #[test] fn tilde_144_1() { let expr = "xy"; test_braille("Nemeth", expr, "⠭⠀⠈⠱⠀⠽"); } #[test] fn set_vertical_bar_145_1() { let expr = "{x||x|<10}"; test_braille("Nemeth", expr, "⠨⠷⠭⠀⠳⠀⠳⠭⠳⠀⠐⠅⠀⠼⠂⠴⠨⠾"); } #[test] fn vertical_bar_145_4() { // this test was added in an addendum let expr = "P(A|B)"; test_braille("Nemeth", expr, "⠠⠏⠷⠠⠁⠀⠳⠀⠠⠃⠾"); } #[test] fn ratio_151_10() { let expr = "1:23:6"; test_braille("Nemeth", expr, "⠼⠂⠀⠐⠂⠀⠼⠆⠀⠰⠆⠀⠼⠒⠀⠐⠂⠀⠼⠖"); } #[test] fn ratio_151_11() { let expr = "a+b:bc+d:d"; test_braille("Nemeth", expr, "⠁⠬⠃⠀⠐⠂⠀⠃⠀⠰⠆⠀⠉⠬⠙⠀⠐⠂⠀⠙"); } #[test] fn space_after_punct_bug_152() { // this was a bug involving a bad cleanup rule for whitespace after punctuation let expr = "7=?8"; test_braille("Nemeth", expr, "⠼⠶⠀⠐⠨⠅⠣⠸⠦⠻⠀⠼⠦"); } #[test] fn arrow_lesson_9_5_1() { // Nemeth rule 152 let expr = "AB"; test_braille("Nemeth", expr, "⠠⠁⠀⠫⠕⠀⠠⠃"); } #[test] fn not_ratio_nfb_5_7_b_2() { let expr = "{x:x>0}"; test_braille("Nemeth", expr, "⠨⠷⠰⠭⠸⠒⠀⠭⠀⠨⠂⠀⠼⠴⠨⠾"); } #[test] fn not_ratio_nfb_5_7_b_4() { let expr = "p:r=q:s"; test_braille("Nemeth", expr, "⠰⠏⠸⠒⠗⠀⠨⠅⠀⠟⠸⠒⠰⠎"); } #[test] fn trilinear_not_ratio() { let expr = "a:b:c"; // decided because spacing is symmetric, no space added after ':' test_braille("Nemeth", expr, "⠰⠁⠸⠒⠰⠃⠸⠒⠰⠉"); } #[test] fn extension_field_not_ratio() { let expr = "[K:F]"; // decided because spacing is symmetric, no space added after ':' test_braille("Nemeth", expr, "⠈⠷⠰⠠⠅⠸⠒⠰⠠⠋⠈⠾"); } #[test] fn proportional_151_12() { let expr = "xy"; test_braille("Nemeth", expr, "⠭⠀⠸⠿⠀⠽"); } #[test] fn comparison_ops_151_14() { let expr = "{x|0x1}"; test_braille("Nemeth", expr, "⠨⠷⠭⠀⠳⠀⠼⠴⠀⠐⠅⠱⠀⠭⠀⠐⠅⠱⠀⠼⠂⠨⠾"); } #[test] fn no_space_comparison_151_16() { let expr = "(<,=,>)"; test_braille("Nemeth", expr, "⠷⠐⠅⠠⠀⠨⠅⠠⠀⠨⠂⠾"); } #[test] fn in_scripts_comparison_151_17() { let expr = " x=a x=b f (x) d x "; test_braille("Nemeth", expr, "⠮⠰⠭⠀⠰⠨⠅⠀⠁⠘⠭⠀⠘⠨⠅⠀⠃⠐⠋⠷⠭⠾⠙⠭"); } #[test] fn prime_172_5() { let expr = "xi'"; test_braille("Nemeth", expr, "⠭⠄⠰⠊"); } #[test] fn prime_172_6() { let expr = "x1'"; test_braille("Nemeth", expr, "⠭⠄⠂"); } #[test] fn prime_172_8() { let expr = "x¯'"; test_braille("Nemeth", expr, "⠭⠱⠄"); } #[test] fn prime_172_9() { let expr = "5'8''"; test_braille("Nemeth", expr, "⠼⠢⠄⠦⠄⠄"); } #[test] fn multipurpose_177_2_1() { let expr = " x5 "; test_braille("Nemeth", expr, "⠭⠐⠢"); } #[test] fn multipurpose_177_2_2() { let expr = " x .6 "; test_braille("Nemeth", expr, "⠭⠐⠨⠖"); } #[test] fn multipurpose_177_3_1() { let expr = " c0 102 + c1 10+ c2 "; test_braille("Nemeth", expr, "⠉⠴⠐⠂⠴⠘⠆⠐⠬⠉⠂⠐⠂⠴⠬⠉⠆"); } #[test] fn multipurpose_177_5_1() { let expr = "0.a1a2"; test_braille("Nemeth", expr, "⠼⠴⠨⠐⠁⠂⠁⠆⠀⠄⠄⠄"); } #[test] fn multipurpose_177_5_4() { let expr = "3.+.4=3.4"; test_braille("Nemeth", expr, "⠼⠒⠨⠐⠬⠨⠲⠀⠨⠅⠀⠼⠒⠨⠲"); } #[test] fn multipurpose_177_5_5() { let expr = "(3.)"; test_braille("Nemeth", expr, "⠷⠒⠨⠐⠾"); } #[test] fn multipurpose_177_5_6() { let expr = "1.2."; test_braille("Nemeth", expr, "⠹⠂⠨⠐⠌⠆⠨⠐⠼"); } #[test] fn multipurpose_177_7_1() { let expr = "|x||y|"; test_braille("Nemeth", expr, "⠳⠭⠳⠐⠳⠽⠳"); } #[test] fn multipurpose_177_7_2() { let expr = "xy"; test_braille("Nemeth", expr, "⠳⠳⠭⠳⠳⠐⠳⠳⠽⠳⠳"); } #[test] fn multipurpose_177_7_9() { let expr = "T"; test_braille("Nemeth", expr, "⠈⠱⠐⠈⠱⠠⠞"); } #[test] fn no_multipurpose_lesson_5_2_6() { let expr = "-10++5"; test_braille("Nemeth", expr, "⠤⠼⠂⠴⠬⠬⠢"); } #[test] fn multipurpose_lesson_5_9_1_1() { let expr = "n><1"; test_braille("Nemeth", expr, "⠝⠀⠨⠂⠐⠐⠅⠀⠼⠂"); } #[test] fn multipurpose_lesson_5_9_2_1() { let expr = "n<>1"; test_braille("Nemeth", expr, "⠝⠀⠐⠅⠐⠨⠂⠀⠼⠂"); } #[test] fn multipurpose_lesson_5_9_2_2() { let expr = "n<=>1"; test_braille("Nemeth", expr, "⠝⠀⠐⠅⠐⠨⠅⠐⠨⠂⠀⠼⠂"); } #[test] fn lesson_11_24_1() { let expr = "x2"; test_braille("Nemeth", expr, "⠫⠅⠭⠘⠆⠐⠻"); } #[test] fn ms_38_4_8() { let expr = "(three)"; test_braille("Nemeth", expr, "⠷⠸⠦⠞⠓⠗⠑⠑⠴⠾"); } #[test] fn ms() { let expr = "a string,another string"; // Not 100% sure this is the right output -- I am a little skeptical of "⠄⠄" being the braille for '"' // Note: no punct indicator after word (see 38_4_8) test_braille("Nemeth", expr, "⠄⠄⠁⠀⠎⠞⠗⠊⠝⠛⠄⠄⠠⠀⠸⠠⠦⠁⠝⠕⠞⠓⠑⠗⠀⠎⠞⠗⠊⠝⠛⠴⠠"); } #[test] fn full_binomial() { let expr = " ( x + a ) n = k = 0 n ( n k ) x k a n k "; test_braille("Nemeth", expr, "⠷⠭⠬⠁⠾⠘⠝⠀⠨⠅⠀⠐⠨⠠⠎⠩⠅⠀⠨⠅⠀⠼⠴⠣⠝⠻⠷⠝⠩⠅⠾⠭⠘⠅⠐⠁⠘⠝⠤⠅"); } // Extra tests targeted at special cases in MathCAT #[test] fn number_space_before() { let expr = " 2"; test_braille("Nemeth", expr, "⠼⠆"); } #[test] fn number_space_after() { let expr = "2 "; test_braille("Nemeth", expr, "⠼⠆"); } #[test] fn number_space_before_and_after() { let expr = " 2 "; test_braille("Nemeth", expr, "⠼⠆"); } #[test] fn tensor_from_mathml_spec() { let expr = " R i j k l "; // Note: the braille answer was verified to be correct (see https://github.com/NSoiffer/MathCAT/issues/55) test_braille("Nemeth", expr, "⠠⠗⠰⠊⠐⠘⠚⠐⠰⠅⠐⠰⠇"); } // The following are chemistry tests from Braille Code of Chemical Notation 1997 (http://www.brl.org/chemistry/ which seems bug, update in late 2023?) #[test] fn chem_HOH_1_1_1_mchem() { let expr = " H - O - H "; test_braille("Nemeth", expr, "⠠⠓⠸⠒⠻⠠⠕⠸⠒⠻⠠⠓"); } // The following are chemistry tests from Braille Code of Chemical Notation 1997 (http://www.brl.org/chemistry/ which seems bug, update in late 2023?) #[test] fn chem_2_5_1_mchem() { let expr = " CaC A 2 + 2 HOH H C C H + Ca ( OH ) A 2 "; // The example uses a short right arrow but chemistry normally uses a long one -- this test has a long right arrow so that char differs from the reference test_braille("Nemeth", expr, "⠠⠉⠁⠠⠉⠆⠬⠆⠠⠓⠠⠕⠠⠓⠀⠫⠒⠒⠒⠕⠀⠠⠓⠸⠒⠻⠠⠉⠸⠿⠻⠠⠉⠸⠒⠻⠠⠓⠬⠠⠉⠁⠷⠠⠕⠠⠓⠾⠰⠆"); }