use crate::common::*; #[test] fn msub_simple() { let expr = " x 1 "; test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "x 1"); test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Medium")], expr, "x sub 1"); test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "x sub 1"); } #[test] fn msub_not_simple() { let expr = " x 1.2 "; test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "x sub 1.2"); } #[test] fn msubsup_not_simple() { let expr = " x 1.2 3 "; test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "x sub 1.2, cubed"); } #[test] fn msub_simple_mi() { let expr = " x i "; test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "x sub i"); test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "x sub i"); } #[test] fn msub_simple_number_follows() { let expr = " x 1 102 "; test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "x 1 10 squared"); test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "x sub 1 10 squared"); } #[test] fn msub_simple_non_number_follows() { let expr = " x 1 2 "; test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "x 1, squared"); test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "x sub 1, squared"); } #[test] fn msubsup_simple() { let expr = " x 1 x,2 "; test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "x 1 x squared"); test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "x sub 1 x squared"); }