use crate::common::*; #[test] fn multiplication() { let expr = " 2×3 "; test("en", "ClearSpeak", expr, "2 times 3"); } #[test] fn multiplication_by() { let expr = " 2×3 "; test_ClearSpeak("en", "ClearSpeak_MultSymbolX", "By", expr, "2 by 3"); } #[test] fn multiplication_cross() { let expr = " u×v "; test_ClearSpeak("en", "ClearSpeak_MultSymbolX", "Cross", expr, "u cross v"); } #[test] fn ellipses_auto_start() { let expr = " , -2,-1,0 "; test("en", "ClearSpeak", expr, "dot dot dot comma negative 2 comma negative 1 comma 0"); } #[test] fn ellipses_auto_end() { let expr = " 1 , 2 , 3 , "; test_ClearSpeak("en", "ClearSpeak_Ellipses", "Auto", expr, "1 comma 2 comma 3 comma dot dot dot"); } #[test] fn ellipses_auto_middle() { let expr = " 1 , 2 , 3 , , 20 "; test_ClearSpeak("en", "ClearSpeak_Ellipses", "Auto", expr, "1 comma 2 comma 3 comma dot dot dot comma 20"); } #[test] fn ellipses_auto_both() { let expr = " , -2,-1,0,1,2 , "; test_ClearSpeak("en", "ClearSpeak_Ellipses", "Auto", expr, "dot dot dot comma negative 2 comma negative 1 comma 0 comma 1 comma 2 comma dot dot dot"); } #[test] fn ellipses_and_so_on_start() { let expr = " , -2,-1,0 "; test_ClearSpeak("en", "ClearSpeak_Ellipses", "AndSoOn", expr, "dot dot dot comma negative 2 comma negative 1 comma 0"); } #[test] fn ellipses_and_so_on_end() { let expr = " 1 , 2 , 3 , "; test_ClearSpeak("en", "ClearSpeak_Ellipses", "AndSoOn", expr, "1 comma 2 comma 3 and so on"); } #[test] fn ellipses_and_so_on_middle() { let expr = " 1 , 2 , 3 , , 20 "; test_ClearSpeak("en", "ClearSpeak_Ellipses", "AndSoOn", expr, "1 comma 2 comma 3 and so on up to 20"); } #[test] fn ellipses_and_so_on_both() { let expr = " , -2,-1,0,1,2 , "; test_ClearSpeak("en", "ClearSpeak_Ellipses", "AndSoOn", expr, "dot dot dot comma negative 2 comma negative 1 comma 0 comma 1 comma 2 comma dot dot dot"); } #[test] fn vertical_line_auto() { let expr = " 3|6 "; test_ClearSpeak("en", "ClearSpeak_VerticalLine", "Auto", expr, "3 divides 6"); } #[test] fn vertical_line_divides() { let expr = " 3|6 "; test_ClearSpeak("en", "ClearSpeak_VerticalLine", "Divides", expr, "3 divides 6"); } #[test] fn vertical_line_given() { let expr = " 3|6 "; test_ClearSpeak("en", "ClearSpeak_VerticalLine", "Given", expr, "3 given 6"); } #[test] fn vertical_line_probability_given() { let expr = " P ( A | B ) "; test_ClearSpeak_prefs("en", vec![("ClearSpeak_VerticalLine", "Given"), ("ClearSpeak_ImpliedTimes", "None")] , expr, "cap p, open paren, cap eigh given cap b, close paren"); } #[test] fn vertical_line_set() { let expr = " { x | x > 0 } "; test_ClearSpeak("en", "ClearSpeak_VerticalLine", "Auto", expr, "the set of all x such that x is greater than 0"); } #[test] fn vertical_line_set_such_that() { let expr = " { x | x > 0 } "; test_ClearSpeak("en", "ClearSpeak_VerticalLine", "SuchThat", expr, "the set of all x such that x is greater than 0"); } #[test] fn vertical_line_set_given() { let expr = " { x | x > 0 } "; // the rules for set will override all the options -- ClearSpeak spec should be clarified test_ClearSpeak("en", "ClearSpeak_VerticalLine", "Given", expr, "the set of all x such that x is greater than 0"); } #[test] fn vertical_line_set_and_abs() { let expr = " { x | | x | > 2 } "; test_ClearSpeak("en", "ClearSpeak_VerticalLine", "Auto", expr, "the set of all x such that the absolute value of x; is greater than 2"); } #[test] fn vertical_line_evaluated_at() { let expr = " f ( x ) | x = 5 "; test_ClearSpeak("en", "ClearSpeak_VerticalLine", "Auto", expr, "f of x evaluated at, x is equal to 5"); } #[test] fn vertical_line_evaluated_at_both() { let expr = " x 2 + x | 0 1 "; test_ClearSpeak("en", "ClearSpeak_VerticalLine", "Auto", expr, "x squared plus x, evaluated at 1 minus the same expression evaluated at 0"); } #[test] fn vertical_line_evaluated_at_divides() { let expr = " f ( x ) | x = 5 "; test_ClearSpeak("en", "ClearSpeak_VerticalLine", "Divides", expr, "f of x evaluated at, x is equal to 5"); } #[test] fn vertical_line_evaluated_at_both_given() { let expr = " x 2 + x | 0 1 "; test_ClearSpeak("en", "ClearSpeak_VerticalLine", "Given", expr, "x squared plus x, evaluated at 1 minus the same expression evaluated at 0"); }