// Other tests for LaTeX generation use crate::common::*; #[test] fn menclose_strikes () { let expr = r#" x "#; test_braille("ASCIIMath", expr, r"\cancel(x)"); } #[test] fn menclose_box_and_circle () { let expr = r#" x "#; // box and circle aren't part of ASCIIMath test_braille("ASCIIMath", expr, r"|overline(underline(x))|"); } #[test] fn menclose_sides () { let expr = r#" x x "#; test_braille("ASCIIMath", expr, r"|x|overline(underline(x))"); } #[test] fn menclose_all_sides() { let expr = r#" x "#; test_braille("ASCIIMath", expr, r"|overline(underline(x))|"); } #[test] fn menclose_diagonal_arrows() { let expr = r#" x "#; // arrows aren't part of ASCIIMath test_braille("ASCIIMath", expr, r"x"); } #[test] fn menclose_double_arrows() { // extra spaces are deliberate -- they shouldn't make a difference let expr = r#" x "#; // arrows aren't part of ASCIIMath test_braille("ASCIIMath", expr, r"x"); } #[test] fn menclose_horiz_and_vert_arrows() { let expr = r#" x "#; // arrows aren't part of ASCIIMath test_braille("ASCIIMath", expr, r"x"); } #[test] fn char_test() { let expr = r#" A, A, C, l, P, X, H, z, t, x,h "#; test_braille("ASCIIMath", expr, r"bb A, bbb A, CC, cc l, cc P, tt X, fr H, fr z, sf t, x, h"); } #[test] fn quadratic_formula() { let expr = r#" x = - b ± b2-4ac 2a "#; test_braille("ASCIIMath", expr, r"x = (-b+-sqrt(b^2-4ac))/(2a)"); } #[test] fn porportional() { let expr = r#" a b "#; test_braille("ASCIIMath", expr, r"a prop b"); } #[test] fn bracketing() { let expr = r#" x = |a-b| "#; test_braille("ASCIIMath", expr, r"x = <<|__|a-b| __|>>"); } #[test] fn dydx() { let expr = r#" f (x) = dy dx "#; test_braille("ASCIIMath", expr, r"f'(x) = dy/dx"); } #[test] fn dqdp() { let expr = r#" dq dp "#; test_braille("ASCIIMath", expr, r"(dq)/(dp)"); } #[test] fn norm() { let expr = r#" x "#; test_braille("ASCIIMath", expr, r"norm(vec x)"); } #[test] fn above_and_below() { let expr = r#" 1+2 , x-y , xy , xy "#; test_braille("ASCIIMath", expr, r"ubrace(1+2), obrace(x-y), underset(x->y)(->), overset(x->y)(lArr)"); } #[test] fn dots_and_bars() { let expr = r#" x^ , x¯ , x+y̲ , x , x. , y.. "#; test_braille("ASCIIMath", expr, r"hat x, bar x, ul(x+y), vec bb x, dot x, ddot y"); } #[test] fn backslash() { let expr = r#" a \ b "#; test_braille("ASCIIMath", expr, r"a\\b"); } #[test] fn text_and_space() { let expr = r#" a   some text   b "#; test_braille("ASCIIMath", expr, r#"a\ "some text"\ b"#); } #[test] fn mixed_fraction() { let expr = r#"212"#; test_braille("ASCIIMath", expr, r#"2 1/2"#); }