// Based on UEB test cases and apply for Vietnamese Math Braille cases. // Many test cases are taken from the official Vietnamese Braille code 2019, and from Mr. Nguyễn Quyết Thắng, a blind math teacher at Saigon NDC school for the blind. // Functions are named as its type + section number. use crate::common::*; #[test] fn subset_1a() { let expr = "A=1;2;3;4;5;...;100"; test_braille("Vietnam", expr, "⠨⠁⠐⠶⠸⠣⠼⠁⠆⠼⠃⠆⠼⠉⠆⠼⠙⠆⠼⠑⠆⠄⠄⠄⠆⠼⠁⠚⠚⠸⠜"); } #[test] fn subset_1b() { let expr = "xN|1x10"; test_braille("Vietnam", expr, "⠭⠈⠑⠨⠝⠸⠳⠼⠁⠐⠪⠶⠭⠐⠪⠶⠼⠁⠚"); } #[test] fn subset_1c() { let expr = "xR|x20"; test_braille("Vietnam", expr, "⠘⠁⠭⠈⠑⠨⠗⠸⠳⠭⠔⠼⠃⠐⠕⠶⠼⠚"); } #[test] fn subset_1d() { let expr = " xR|x2 0 "; test_braille("Vietnam", expr, "⠘⠑⠭⠈⠑⠨⠗⠸⠳⠭⠔⠼⠃⠐⠪⠶⠼⠚"); } #[test] fn subset_1e() { let expr = " xN "; test_braille("Vietnam", expr, "⠭⠈⠑⠈⠨⠝"); } #[test] fn subset_1f() { let expr = " AB "; test_braille("Vietnam", expr, "⠨⠁⠘⠣⠨⠃"); } #[test] fn subset_1g() { let expr = " BA"; test_braille("Vietnam", expr, "⠨⠃⠘⠜⠨⠁"); } #[test] fn subset_1h() { let expr = " AB= "; test_braille("Vietnam", expr, "⠨⠁⠨⠦⠨⠃⠐⠶⠈⠚"); } #[test] fn subset_1i() { let expr = " A=BC"; test_braille("Vietnam", expr, "⠨⠁⠐⠶⠨⠃⠨⠖⠨⠉"); } #[test] fn subset_1j() { let expr = "nN|2n2"; test_braille("Vietnam", expr, "⠘⠁⠝⠈⠑⠨⠝⠸⠳⠼⠃⠝⠣⠴⠜⠼⠃"); } #[test] fn subset_1k() { let expr = "xQ|3x 3"; test_braille("Vietnam", expr, "⠘⠑⠭⠈⠑⠨⠟⠸⠳⠼⠉⠭⠣⠼⠜⠼⠉"); } #[test] fn subset_1l() { let expr = " D=R\ 1;2 "; test_braille("Vietnam", expr, "⠨⠙⠐⠶⠨⠗⠸⠡⠸⠣⠼⠁⠆⠼⠃⠸⠜"); } #[test] fn frac_2a() { let expr = " 12 +34 37 "; test_braille("Vietnam", expr, "⠼⠁⠌⠃⠐⠖⠼⠉⠌⠙⠐⠤⠼⠉⠌⠛"); } #[test] fn drop_frac_2a() { let expr = " 12 +34 37 "; libmathcat::set_rules_dir(abs_rules_dir_path()).unwrap(); libmathcat::set_preference("Vietnam_UseDropNumbers".to_string(), "true".to_string()).unwrap(); test_braille("Vietnam", expr, "⠼⠁⠆⠐⠖⠼⠉⠲⠐⠤⠼⠉⠶"); } #[test] fn frac_2b() { let expr = " 23 × 25 49 ÷7 15 "; test_braille("Vietnam", expr, "⠼⠃⠌⠉⠐⠦⠈⠣⠼⠃⠌⠑⠐⠤⠼⠙⠌⠊⠈⠜⠐⠲⠼⠛⠌⠁⠑"); } #[test] fn frac_2c() { let expr = " x+2 x2 = 2x1 4x+3 "; test_braille("Vietnam", expr, "⠆⠭⠐⠖⠼⠃⠌⠭⠐⠤⠼⠃⠰⠐⠶⠆⠼⠃⠭⠐⠤⠼⠁⠌⠼⠙⠭⠐⠖⠼⠉⠰"); } #[test] fn exponent_3a () { let expr = " 23 +24 2 2022 "; test_braille("Vietnam", expr, "⠼⠃⠔⠼⠉⠐⠖⠼⠃⠔⠼⠙⠐⠤⠼⠃⠔⠼⠃⠚⠃⠃"); } #[test] fn exponent_3b () { let expr = " (x+2)3 =x3 +6x2 +12x+8"; test_braille("Vietnam", expr, "⠈⠣⠭⠐⠖⠼⠃⠈⠜⠔⠼⠉⠐⠶⠭⠔⠼⠉⠐⠖⠼⠋⠭⠔⠼⠃⠐⠖⠼⠁⠃⠭⠐⠖⠼⠓"); } #[test] fn exponent_3c () { let expr = " 23 5 × 32 5 =1"; test_braille("Vietnam", expr, "⠼⠃⠌⠉⠔⠼⠑⠐⠦⠼⠉⠌⠃⠔⠼⠑⠐⠶⠼⠁"); } #[test] fn exponent_3d () { let expr = " x2 +x+1 13 x1 "; test_braille("Vietnam", expr, "⠆⠭⠔⠼⠃⠐⠖⠭⠐⠖⠼⠁⠌⠼⠁⠌⠉⠭⠐⠤⠼⠁⠰"); } #[test] fn exponent_3e () { let expr = " 2 2x+1 3×2x +1=0"; test_braille("Vietnam", expr, "⠼⠃⠔⠣⠼⠃⠭⠐⠖⠼⠁⠱⠐⠤⠼⠉⠐⠦⠼⠃⠔⠭⠐⠖⠼⠁⠐⠶⠼⠚"); } #[test] fn exponent_3f () { let expr = " 2×2 2x 3×2x +1=0"; test_braille("Vietnam", expr, "⠳⠪⠶⠕⠼⠃⠐⠦⠼⠃⠔⠣⠼⠃⠭⠱⠐⠤⠼⠉⠐⠦⠼⠃⠔⠭⠐⠖⠼⠁⠐⠶⠼⠚"); } #[test] fn exponent_3g () { let expr = " t=2x "; test_braille("Vietnam", expr, "⠞⠐⠶⠼⠃⠔⠭"); } #[test] fn exponent_3h () { let expr = " (t0)"; test_braille("Vietnam", expr, "⠈⠣⠞⠐⠕⠶⠼⠚⠈⠜"); } #[test] fn exponent_3i () { let expr = " 2t2 3t+1=0"; test_braille("Vietnam", expr, "⠼⠃⠞⠔⠼⠃⠐⠤⠼⠉⠞⠐⠖⠼⠁⠐⠶⠼⠚"); } #[test] fn exponent_3j () { let expr = " t=12x =1x=0"; test_braille("Vietnam", expr, "⠞⠐⠶⠼⠁⠳⠪⠶⠕⠼⠃⠔⠭⠐⠶⠼⠁⠳⠪⠶⠕⠭⠐⠶⠼⠚"); } #[test] fn exponent_3k () { let expr = " t=12 =2x =12 x=1"; test_braille("Vietnam", expr, "⠞⠐⠶⠼⠁⠌⠃⠐⠶⠼⠃⠔⠭⠐⠶⠼⠁⠌⠃⠳⠪⠶⠕⠭⠐⠶⠐⠤⠼⠁"); } #[test] fn log_b1 () { let expr = " log2 x+1+ log2 x+2= log2 2"; test_braille("Vietnam", expr, "⠇⠕⠛⠢⠼⠃⠭⠐⠖⠼⠁⠐⠖⠇⠕⠛⠢⠼⠃⠭⠐⠖⠼⠃⠐⠶⠇⠕⠛⠢⠼⠃⠼⠃"); } #[test] fn root_4a () { let expr = " 2 +3 5 "; test_braille("Vietnam", expr, "⠩⠼⠃⠱⠐⠖⠩⠼⠉⠱⠐⠤⠩⠼⠑⠱"); } #[test] fn root_4b () { let expr = " 273 + 325 "; test_braille("Vietnam", expr, "⠩⠔⠼⠉⠼⠃⠛⠱⠐⠖⠩⠔⠼⠑⠼⠉⠃⠱"); } #[test] fn root_4c () { let expr = " x+1 + x+3 "; test_braille("Vietnam", expr, "⠩⠭⠐⠖⠼⠁⠱⠐⠖⠩⠭⠐⠖⠼⠉⠱"); } #[test] fn root_4d () { let expr = " x +3 2x+3 +5 x+2x 5 + 12 x+32 "; test_braille("Vietnam", expr, "⠆⠩⠭⠱⠐⠖⠼⠉⠌⠼⠃⠭⠐⠖⠼⠉⠰⠐⠖⠆⠼⠑⠌⠭⠐⠖⠼⠃⠩⠭⠱⠐⠤⠼⠑⠰⠐⠖⠩⠼⠁⠌⠃⠭⠐⠖⠼⠉⠌⠃⠱"); } #[test] fn quadratic_5a1 () { let expr = " ax2 +bx+c=0   (a0)"; test_braille("Vietnam", expr, "⠁⠭⠔⠼⠃⠐⠖⠃⠭⠐⠖⠉⠐⠶⠼⠚⠀⠈⠣⠁⠐⠾⠼⠚⠈⠜"); } #[test] fn quadratic_5a2 () { let expr = " Δ=b2 4ac"; test_braille("Vietnam", expr, "⠸⠙⠐⠶⠃⠔⠼⠃⠐⠤⠼⠙⠠⠁⠉"); } #[test] fn quadratic_5a3 () { let expr = " Δ<0"; test_braille("Vietnam", expr, "⠸⠙⠐⠪⠼⠚"); } #[test] fn quadratic_5a4 () { let expr = " Δ=0"; test_braille("Vietnam", expr, "⠸⠙⠐⠶⠼⠚"); } #[test] fn quadratic_5a5 () { let expr = " x1 =x2 = b 2a "; test_braille("Vietnam", expr, "⠭⠢⠼⠁⠐⠶⠭⠢⠼⠃⠐⠶⠆⠐⠤⠃⠌⠼⠃⠠⠁⠰"); } #[test] fn quadratic_5a6 () { let expr = " Δ>0"; test_braille("Vietnam", expr, "⠸⠙⠐⠕⠼⠚"); } #[test] fn quadratic_5a7 () { let expr = " x1 = b+Δ 2a "; test_braille("Vietnam", expr, "⠭⠢⠼⠁⠐⠶⠆⠐⠤⠃⠐⠖⠩⠸⠙⠱⠌⠼⠃⠠⠁⠰"); } #[test] fn quadratic_5a8 () { let expr = " x2 = bΔ 2a "; test_braille("Vietnam", expr, "⠭⠢⠼⠃⠐⠶⠆⠐⠤⠃⠐⠤⠩⠸⠙⠱⠌⠼⠃⠠⠁⠰"); } #[test] fn sin_7 () { let expr = " sinB= AC BC "; test_braille("Vietnam", expr, "⠻⠎⠨⠃⠐⠶⠆⠸⠁⠉⠌⠸⠃⠉⠰"); } #[test] fn cos_7 () { let expr = " cosB= AB BC "; test_braille("Vietnam", expr, "⠻⠉⠨⠃⠐⠶⠆⠸⠁⠃⠌⠸⠃⠉⠰"); } #[test] fn tan_7 () { let expr = " tanB= AC AB "; test_braille("Vietnam", expr, "⠻⠞⠨⠃⠐⠶⠆⠸⠁⠉⠌⠸⠁⠃⠰"); } #[test] fn cot_7 () { let expr = " cotB= AB AC "; test_braille("Vietnam", expr, "⠻⠉⠞⠨⠃⠐⠶⠆⠸⠁⠃⠌⠸⠁⠉⠰"); } #[test] fn sincos_7e () { let expr = " sinx+cosx=2 sin x+π4 "; test_braille("Vietnam", expr, "⠻⠎⠭⠐⠖⠻⠉⠭⠐⠶⠩⠼⠃⠱⠻⠎⠈⠣⠭⠐⠖⠆⠰⠏⠌⠼⠙⠰⠈⠜"); } #[test] fn lim_8a () { let expr = " lim x x2 +3x+1 3x2 4 "; test_braille("Vietnam", expr, "⠇⠊⠍⠢⠣⠭⠳⠕⠼⠕⠱⠆⠭⠔⠼⠃⠐⠖⠼⠉⠭⠐⠖⠼⠁⠌⠼⠉⠭⠔⠼⠃⠐⠤⠼⠙⠰"); } #[test] fn prime_9a () { let expr = " y =2x+3"; test_braille("Vietnam", expr, "⠽⠄⠐⠶⠼⠃⠭⠐⠖⠼⠉"); } #[test] fn integral_9b () { let expr = " x 2+3x+2 dx"; test_braille("Vietnam", expr, "⠾⠭⠔⠼⠃⠐⠖⠼⠉⠭⠐⠖⠼⠃⠠⠙⠭"); } #[test] fn integral_9c () { let expr = " 0 π 4 sin2 x dx"; test_braille("Vietnam", expr, "⠾⠢⠼⠚⠔⠆⠰⠏⠌⠼⠙⠰⠻⠎⠔⠼⠃⠭⠙⠭"); } #[test] fn angle_10a () { let expr = " ABC^ =40°"; test_braille("Vietnam", expr, "⠫⠛⠸⠁⠃⠉⠐⠶⠼⠙⠚⠔⠚"); } #[test] fn parallel_10b () { let expr = " ABCD"; test_braille("Vietnam", expr, "⠸⠁⠃⠫⠶⠸⠉⠙"); } #[test] fn perp_10b1 () { let expr = " SA(ABCD)"; test_braille("Vietnam", expr, "⠸⠎⠁⠫⠧⠈⠣⠸⠁⠃⠉⠙⠈⠜"); } #[test] fn vector_10c () { let expr = " AB + BC = AC "; test_braille("Vietnam", expr, "⠣⠸⠁⠃⠜⠨⠔⠳⠕⠐⠖⠣⠸⠃⠉⠜⠨⠔⠳⠕⠐⠶⠣⠸⠁⠉⠜⠨⠔⠳⠕"); } #[test] fn vector_10d () { let expr = " | AB |= x AB2 +y AB2 "; test_braille("Vietnam", expr, "⠸⠳⠣⠸⠁⠃⠜⠨⠔⠳⠕⠸⠳⠐⠶⠩⠭⠢⠣⠸⠁⠃⠜⠔⠼⠃⠐⠖⠽⠢⠣⠸⠁⠃⠜⠔⠼⠃⠱"); } #[test] fn greek_1_1 () { let expr = "αΑ"; test_braille("Vietnam", expr, "⠰⠁⠸⠁"); } #[test] fn log_b2 () { let expr = "log32x+2log2x+3=0"; test_braille("Vietnam", expr, "⠇⠕⠛⠔⠼⠃⠢⠼⠉⠭⠐⠖⠼⠃⠇⠕⠛⠢⠼⠃⠭⠐⠖⠼⠉⠐⠶⠼⠚"); } #[test] fn rnumber_1_1 () { let expr = r#"A={xR|x21}"#; test_braille("Vietnam", expr, "⠨⠁⠐⠶⠸⠣⠭⠈⠑⠨⠗⠸⠳⠭⠔⠼⠃⠐⠕⠶⠼⠁⠸⠜"); } #[test] fn mtable_1_1 () { let expr = "x+y=52xy=1"; test_braille("Vietnam", expr, "⠸⠣⠭⠐⠖⠽⠐⠶⠼⠑⣍⠸⠣⠼⠃⠭⠐⠤⠽⠐⠶⠼⠁"); } #[test] fn mtable_1_2 () { let expr = r#"x=5x=7"#; test_braille("Vietnam", expr, "⠨⠣⠭⠐⠶⠼⠑⣍⠨⠣⠭⠐⠶⠐⠤⠼⠛"); } #[test] fn number_1 () { let expr = "3.000,12"; test_braille("Vietnam", expr, "⠼⠉⠄⠚⠚⠚⠂⠁⠃"); } #[test] fn number_1a () { let expr = "3,000.12"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠉⠄⠚⠚⠚⠂⠁⠃"); } #[test] fn number_2 () { let expr = "3,14"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠉⠂⠁⠙"); } #[test] fn number_2a () { let expr = "3.14"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠉⠂⠁⠙"); } #[test] fn number_3 () { let expr = "1.000"; test_braille("Vietnam", expr, "⠼⠁⠄⠚⠚⠚"); } #[test] #[ignore] fn number_3a () { let expr = "1,000"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠁⠄⠚⠚⠚"); } #[test] fn number_3b () { let expr = "1.234"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠁⠄⠃⠉⠙"); } #[test] fn number_3c () { let expr = "1,234"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠁⠂⠃⠉⠙"); } #[test] fn number_4 () { let expr = "1.000.000"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠁⠄⠚⠚⠚⠄⠚⠚⠚"); } #[test] fn number_4a () { let expr = "1,000,000"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠁⠄⠚⠚⠚⠄⠚⠚⠚"); } #[test] fn number_5 () { let expr = "123.456.789,987"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠁⠃⠉⠄⠙⠑⠋⠄⠛⠓⠊⠂⠊⠓⠛"); } #[test] fn number_5a () { let expr = "123,456,789.987"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠁⠃⠉⠄⠙⠑⠋⠄⠛⠓⠊⠂⠊⠓⠛"); } #[test] fn number_6 () { let expr = ",57"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠂⠑⠛"); } #[test] fn number_6a () { let expr = ".57"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠂⠑⠛"); } #[test] fn number_6b () { let expr = "0,57"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠚⠂⠑⠛"); } #[test] fn number_6c () { let expr = "0.57"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠚⠂⠑⠛"); } #[test] fn number_7 () { let expr = ",578"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠂⠑⠛⠓"); } #[test] fn number_7a () { let expr = ".578"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠂⠑⠛⠓"); } #[test] fn number_7b () { let expr = "0,578"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠚⠂⠑⠛⠓"); } #[test] fn number_7c () { let expr = "0.578"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠚⠂⠑⠛⠓"); } #[test] fn meter_1 () { let expr = "5,72m/10=57,2cm"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠑⠂⠛⠃⠀⠍⠐⠲⠼⠁⠚⠐⠶⠼⠑⠛⠂⠃⠀⠉⠍"); } #[test] fn meter_2 () { let expr = "1km=10hm=100dam=1.000m=10.000dm=100.000cm=1.000.000mm"; test_braille_prefs("Vietnam", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, "⠼⠁⠀⠅⠍⠐⠶⠼⠁⠚⠀⠓⠍⠐⠶⠼⠁⠚⠚⠀⠙⠁⠍⠐⠶⠼⠁⠄⠚⠚⠚⠀⠍⠐⠶⠼⠁⠚⠄⠚⠚⠚⠀⠙⠍⠐⠶⠼⠁⠚⠚⠄⠚⠚⠚⠀⠉⠍⠐⠶⠼⠁⠄⠚⠚⠚⠄⠚⠚⠚⠀⠍⠍"); } #[test] fn gram_1 () { let expr = "1tấn=10tạ=100yến=1.000kg=10.000hg=100.000dag=1.000.000g"; test_braille("Vietnam", expr, "⠼⠁⠀⠞⠔⠡⠝⠐⠶⠼⠁⠚⠀⠞⠠⠁⠐⠶⠼⠁⠚⠚⠀⠔⠽⠣⠝⠐⠶⠼⠁⠄⠚⠚⠚⠀⠅⠛⠐⠶⠼⠁⠚⠄⠚⠚⠚⠀⠓⠛⠐⠶⠼⠁⠚⠚⠄⠚⠚⠚⠀⠙⠁⠛⠐⠶⠼⠁⠄⠚⠚⠚⠄⠚⠚⠚⠀⠛"); } #[test] fn liquid_1 () { let expr = "1lít=1l=1.000ml"; test_braille("Vietnam", expr, "⠼⠁⠀⠇⠔⠊⠞⠐⠶⠼⠁⠀⠇⠐⠶⠼⠁⠄⠚⠚⠚⠀⠍⠇"); } #[test] fn feet_1 () { let expr = "1ft+3in"; test_braille("Vietnam", expr, "⠼⠁⠀⠋⠞⠐⠖⠼⠉⠀⠊⠝"); } #[test] fn cap_1 () { let expr = "AB+Cd=eF"; test_braille("Vietnam", expr, "⠸⠁⠃⠐⠖⠨⠉⠙⠐⠶⠑⠨⠋"); } #[test] fn cap_2 () { let expr = "AB+Cd=eF"; test_braille("Vietnam", expr, "⠸⠁⠃⠐⠖⠨⠉⠙⠐⠶⠑⠨⠋"); } #[test] fn vi_letters () { let expr = "Cho Phương Trình Ax+B=0 TA ĐƯỢC x"; test_braille("Vietnam", expr, "⠨⠉⠓⠕⠀⠨⠏⠓⠳⠪⠝⠛⠀⠨⠞⠗⠰⠊⠝⠓⠀⠨⠁⠭⠐⠖⠨⠃⠐⠶⠼⠚⠀⠸⠞⠁⠀⠸⠮⠳⠠⠪⠉⠀⠭"); } // Chemistry test cases #[test] fn salt() { let expr = "NaCl"; test_braille("Vietnam", expr, "⠨⠝⠁⠨⠉⠇"); } #[test] fn water() { let expr = "H2O"; test_braille("Vietnam", expr, "⠨⠓⠢⠼⠃⠨⠕"); } #[test] fn carbon() { let expr = "C"; // not enough to trigger recognition test_braille("Vietnam", expr, "⠨⠉"); } #[test] fn sulfate() { let expr = " [SO4] 2 "; test_braille("Vietnam", expr, "⠨⠣⠸⠎⠕⠢⠼⠙⠨⠜⠔⠣⠼⠃⠐⠤⠱"); // When two or more continuous cap letters in one substance, and without sub or super script divided, dots 456 as word cap sign. } #[test] fn aluminum_sulfate() { let expr = "Al2 (SO4)3"; test_braille("Vietnam", expr, "⠨⠁⠇⠢⠼⠃⠈⠣⠸⠎⠕⠢⠼⠙⠈⠜⠢⠼⠉"); } #[test] fn ethanol_bonds() { let expr = " C H 3 C H 2 O H "; test_braille("Vietnam", expr, "⠸⠉⠓⠢⠼⠉⠤⠸⠉⠓⠢⠼⠃⠤⠸⠕⠓"); } #[test] fn dichlorine_hexoxide() { let expr = " [ClO2] + [ClO4] - "; test_braille("Vietnam", expr, "⠨⠣⠨⠉⠇⠨⠕⠢⠼⠃⠨⠜⠔⠐⠖⠨⠣⠨⠉⠇⠨⠕⠢⠼⠙⠨⠜⠔⠐⠤"); } #[test] fn ethylene_with_bond() { let expr = " H2C = CH2 "; test_braille("Vietnam", expr, "⠨⠓⠢⠼⠃⠨⠉⠭⠸⠉⠓⠢⠼⠃"); } #[test] fn ferric_chloride_aq() { let expr = " Fe Cl3 (aq) "; test_braille("Vietnam", expr, "⠨⠋⠑⠨⠉⠇⠢⠼⠉⠈⠣⠁⠟⠈⠜"); } #[test] fn ethylene_with_colon_bond() { let expr = " H2C :: CH2 "; test_braille("Vietnam", expr, "⠨⠓⠢⠼⠃⠨⠉⠭⠸⠉⠓⠢⠼⠃"); // Each bond presented with column is translated with ⠒. So, triple column bonds should be ⠒⠒⠒. } #[test] fn beta_decay() { let expr = " C 6 14 N 7 14 + e 1 0 "; test_braille("Vietnam", expr, "⠨⠉⠢⠮⠼⠋⠔⠞⠼⠁⠙⠳⠕⠨⠝⠢⠮⠼⠛⠔⠞⠼⠁⠙⠐⠖⠑⠢⠮⠣⠐⠤⠼⠁⠜⠔⠞⠼⠚"); } #[test] fn hcl_na_yields() { let expr = " 2HCl+2Na 2NaCl+ H 2 "; test_braille("Vietnam", expr, "⠼⠃⠨⠓⠨⠉⠇⠐⠖⠼⠃⠨⠝⠁⠳⠕⠼⠃⠨⠝⠁⠨⠉⠇⠐⠖⠨⠓⠢⠼⠃"); } #[test] fn mhchem_so4_2plus() { let expr = " SO A 4 A 2 + "; test_braille("Vietnam", expr, "⠸⠎⠕⠢⠼⠙⠔⠣⠼⠃⠐⠖⠱"); } #[test] fn mhchem_hcl_aq_etc() { let expr = " 2 HCl ( aq ) + 2 Na ( s ) 2 NaCl ( aq ) + H A 2 ( g ) "; test_braille("Vietnam", expr, "⠼⠃⠨⠓⠨⠉⠇⠈⠣⠁⠟⠈⠜⠐⠖⠼⠃⠨⠝⠁⠈⠣⠎⠈⠜⠳⠕⠼⠃⠨⠝⠁⠨⠉⠇⠈⠣⠁⠟⠈⠜⠐⠖⠨⠓⠢⠼⠃⠈⠣⠛⠈⠜"); } #[test] fn mhchem_barbed_equilibrium() { let expr = " H 2 ( g ) + I 2 ( g ) - - 2 H I ( g ) "; test_braille("Vietnam", expr, "⠨⠓⠢⠼⠃⠈⠣⠛⠈⠜⠐⠖⠨⠊⠢⠼⠃⠈⠣⠛⠈⠜⠳⠪⠕⠼⠃⠸⠓⠊⠈⠣⠛⠈⠜"); } #[test] fn mhchem_roman_in_superscript() { let expr = " Fe II Fe III O 4 "; test_braille("Vietnam", expr, "⠨⠋⠑⠔⠣⠨⠊⠊⠱⠨⠋⠑⠔⠣⠨⠊⠊⠊⠱⠨⠕⠢⠼⠙"); // all Roman numbers with single or multiple cap letters, are all used only dot 46. } #[test] fn overparen() { let expr = r#"AB"#; test_braille("Vietnam", expr, "⠫⠠⠗⠸⠁⠃"); } #[test] fn vi_text1() { init_logger(); let expr = "quyết giềng quá giệt hằng hỏi lỗi"; test_braille("Vietnam", expr, "⠟⠥⠔⠽⠣⠞⠀⠛⠊⠰⠣⠝⠛⠀⠟⠥⠔⠁⠀⠛⠊⠠⠣⠞⠀⠓⠰⠜⠝⠛⠀⠓⠢⠕⠊⠀⠇⠤⠹⠊"); } #[test] fn vi_text2() { let expr = "thiết hiền biển diễn điện giết"; test_braille("Vietnam", expr, "⠞⠓⠔⠊⠣⠞⠀⠓⠰⠊⠣⠝⠀⠃⠢⠊⠣⠝⠀⠙⠤⠊⠣⠝⠀⠮⠠⠊⠣⠝⠀⠛⠊⠔⠣⠞"); } #[test] fn vi_text31() { let expr = "thuấn thuần chuẩn luận quấn quần quẩn quẫn quận"; test_braille("Vietnam", expr, "⠞⠓⠔⠥⠡⠝⠀⠞⠓⠰⠥⠡⠝⠀⠉⠓⠢⠥⠡⠝⠀⠇⠠⠥⠡⠝⠀⠟⠥⠔⠡⠝⠀⠟⠥⠰⠡⠝⠀⠟⠥⠢⠡⠝⠀⠟⠥⠤⠡⠝⠀⠟⠥⠠⠡⠝"); } #[test] fn vi_text32() { let expr = "thuế huề tuệ quế quệ"; test_braille("Vietnam", expr, "⠞⠓⠔⠥⠣⠀⠓⠰⠥⠣⠀⠞⠠⠥⠣⠀⠟⠥⠔⠣⠀⠟⠥⠠⠣"); } #[test] fn vi_text33() { let expr = "muống truồng cuổng cuỗng chuộng thuở quở"; test_braille("Vietnam", expr, "⠍⠔⠥⠹⠝⠛⠀⠞⠗⠰⠥⠹⠝⠛⠀⠉⠢⠥⠹⠝⠛⠀⠉⠤⠥⠹⠝⠛⠀⠉⠓⠠⠥⠹⠝⠛⠀⠞⠓⠢⠥⠪⠀⠟⠥⠢⠪"); } #[test] fn vi_text34() { let expr = "buýt thùy hủy lũy ngụy quý quýt quỳ quỷ quỹ quỵ"; test_braille("Vietnam", expr, "⠃⠔⠥⠽⠞⠀⠞⠓⠰⠥⠽⠀⠓⠢⠥⠽⠀⠇⠤⠥⠽⠀⠝⠛⠠⠥⠽⠀⠟⠥⠔⠽⠀⠟⠥⠔⠽⠞⠀⠟⠥⠰⠽⠀⠟⠥⠢⠽⠀⠟⠥⠤⠽⠀⠟⠥⠠⠽"); } #[test] fn vi_text35() { let expr = "khuyết thuyền chuyển truyện quyết quyền quyển quyện"; test_braille("Vietnam", expr, "⠅⠓⠔⠥⠽⠣⠞⠀⠞⠓⠰⠥⠽⠣⠝⠀⠉⠓⠢⠥⠽⠣⠝⠀⠞⠗⠠⠥⠽⠣⠝⠀⠟⠥⠔⠽⠣⠞⠀⠟⠥⠰⠽⠣⠝⠀⠟⠥⠢⠽⠣⠝⠀⠟⠥⠠⠽⠣⠝"); } #[test] fn vi_text41() { let expr = "thoát choàng loãng hoạt thoắc hoặc khoén"; test_braille("Vietnam", expr, "⠞⠓⠔⠕⠁⠞⠀⠉⠓⠰⠕⠁⠝⠛⠀⠇⠤⠕⠁⠝⠛⠀⠓⠠⠕⠁⠞⠀⠞⠓⠔⠕⠜⠉⠀⠓⠠⠕⠜⠉⠀⠅⠓⠔⠕⠑⠝"); } #[test] fn vi_text42() { let expr = "thướt cược yến yển"; test_braille("Vietnam", expr, "⠞⠓⠔⠳⠪⠞⠀⠉⠠⠳⠪⠉⠀⠔⠽⠣⠝⠀⠢⠽⠣⠝"); }