/// Tests for:
/// * functions including trig functions, logs, and functions to powers
/// * implied times/functional call and explicit times/function call
/// * parens
/// These are all intertwined, so they are in one file
use crate::common::*;
#[test]
fn trig_names() {
let expr = "";
test("en", "ClearSpeak", expr, "sine of x plus cosine of y plus tangent of z plus secant of alpha, plus cosecant of phi, plus cotangent of phi");
}
#[test]
fn hyperbolic_trig_names() {
let expr = "";
test("en", "ClearSpeak", expr, "hyperbolic sine of x, plus \
hyperbolic cosine of y, plus \
hyperbolic tangent of z, plus \
hyperbolic secant of alpha, plus \
hyperbolic cosecant of phi, plus \
hyperbolic cotangent of phi");
}
#[test]
fn inverse_trig() {
let expr = "";
test("en", "ClearSpeak", expr, "inverse sine of x");
}
#[test]
fn inverse_trig_trig_inverse() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Trig", "TrigInverse",expr,
"tangent inverse of x");
}
#[test]
fn inverse_trig_arc() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Trig", "ArcTrig",expr,
"arc hyperbolic cosine of x");
}
#[test]
fn trig_squared() {
let expr = "";
test("en", "ClearSpeak", expr, "sine squared of x");
}
#[test]
fn trig_cubed() {
let expr = "";
test("en", "ClearSpeak", expr, "tangent cubed of x");
}
#[test]
fn trig_fourth() {
let expr = "";
test("en", "ClearSpeak", expr, "the fourth power of, secant of x");
}
#[test]
fn trig_power_other() {
let expr = "";
test("en", "ClearSpeak", expr, "the n minus 1 power of, hyperbolic sine of x");
}
#[test]
fn simple_log() {
let expr = "";
test("en", "ClearSpeak", expr, "log x");
}
#[test]
fn normal_log() {
let expr = "";
test("en", "ClearSpeak", expr, "the log of, open paren x plus y, close paren");
}
#[test]
fn simple_log_with_base() {
let expr = "";
test("en", "ClearSpeak", expr, "the log base b of x");
}
#[test]
fn normal_log_with_base() {
let expr = "";
test("en", "ClearSpeak", expr, "the log base b of, open paren x plus y, close paren");
}
#[test]
fn simple_ln() {
let expr = "";
test("en", "ClearSpeak", expr, "l n x");
}
#[test]
fn normal_ln() {
let expr = "";
test("en", "ClearSpeak", expr, "the l n of, open paren x plus y, close paren");
}
#[test]
fn simple_natural_log() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Log", "LnAsNaturalLog",expr,
"natural log x");
}
#[test]
fn natural_log() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Log", "LnAsNaturalLog",expr,
"the natural log of, open paren x plus y, close paren");
}
#[test]
fn explicit_function_call_with_parens() {
let expr = "";
test("en", "ClearSpeak", expr, "t of x");
}
#[test]
fn explicit_times_with_parens() {
let expr = "";
test("en", "ClearSpeak", expr, "t times x");
}
#[test]
fn explicit_function_call() {
let expr = "";
test("en", "ClearSpeak", expr, "t of x");
}
#[test]
fn explicit_times() {
let expr = "";
test("en", "ClearSpeak", expr, "t x");
}
#[test]
fn test_functions_none_pref() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Functions", "None",expr,
"the log of, open paren x plus y, close paren; plus, f times, open paren x plus y, close paren");
}
#[test]
fn test_functions_none_pref_multiple_args() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Functions", "None",expr,
"cap b times, open paren 2 comma 6, close paren");
}
/*
* Tests for times
*/
#[test]
fn no_times_binomial() {
let expr = "";
test("en", "ClearSpeak", expr, "x y");
}
#[test]
fn times_following_paren() {
let expr = "";
test("en", "ClearSpeak", expr, "2 times 3");
}
#[test]
fn times_preceding_paren() {
let expr = "";
test("en", "ClearSpeak", expr, "2 times 3");
}
#[test]
fn no_times_sqrt() {
let expr = "";
test("en", "ClearSpeak", expr, "the square root of eigh; the square root of b; is equal to, the square root of eigh b,");
}
#[test]
fn more_implied_times() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_ImpliedTimes", "MoreImpliedTimes",expr,
"open paren 2 times x, close paren squared");
}
#[test]
fn explicit_times_more_implied_times() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_ImpliedTimes", "MoreImpliedTimes",expr, "t times x");
}
#[test]
fn explicit_times_none_simple_right() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_ImpliedTimes", "None",
expr, "2, open bracket 3 close bracket");
}
#[test]
fn explicit_times_none_simple_left() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_ImpliedTimes", "None",
expr, "open paren 2 minus 1, close paren; x");
}
#[test]
fn explicit_times_none_superscript() {
let expr = "";
test_ClearSpeak_prefs("en",
vec![("ClearSpeak_ImpliedTimes", "None"), ("ClearSpeak_Functions", "None")],
expr, "f open paren x close paren; is equal to; x squared, open paren x plus 1, close paren");
}
/*
* Tests for parens
*/
#[test]
fn no_parens_number() {
let expr = "";
test("en", "ClearSpeak", expr, "25 times x");
}
#[test]
fn no_parens_monomial() {
let expr = "";
test("en", "ClearSpeak", expr, "b x y");
}
#[test]
fn no_parens_negative_number() {
let expr = "";
test("en", "ClearSpeak", expr, "2 plus negative 2");
}
#[test]
fn no_parens_negative_number_with_var() {
let expr = "";
test("en", "ClearSpeak", expr, "negative 2 x, plus 1");
}
#[test]
fn parens_superscript() {
let expr = "";
test("en", "ClearSpeak", expr, "open paren 2 x close paren squared");
}
#[test]
fn no_parens_fraction() {
let expr = "";
test("en", "ClearSpeak", expr, "2 plus 1 half");
}
// Tests for the ten types of intervals in ClearSpeak
#[test]
fn parens_interval_open_open() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Paren", "Interval",expr,
"the interval from c to d, not including c or d");
}
#[test]
fn parens_interval_closed_open() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Paren", "Interval ",expr,
"the interval from c to d, including c but not including d");
}
#[test]
fn parens_interval_open_closed() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Paren", "Interval ",expr,
"the interval from c to d, not including c but including d");
}
#[test]
fn parens_interval_closed_closed() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Paren", "Interval ",expr,
"the interval from c to d, including c and d");
}
#[test]
fn parens_interval_neg_infinity_open_open() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Paren", "Interval ",expr,
"the interval from negative infinity to d, not including d");
}
#[test]
fn parens_interval_neg_infinity_closed_open() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Paren", "Interval ",expr,
"the interval from negative infinity to d, including d");
}
#[test]
fn parens_interval_open_open_infinity() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Paren", "Interval ",expr,
"the interval from c to infinity, not including c");
}
#[test]
fn parens_interval_closed_open_infinity() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Paren", "Interval ",expr,
"the interval from c to infinity, including c");
}
#[test]
fn parens_interval_neg_infinity_to_infinity() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Paren", "Interval ",expr,
"the interval from negative infinity to infinity,");
}
#[test]
fn parens_interval_neg_infinity_to_pos_infinity() {
let expr = "";
test_ClearSpeak("en", "ClearSpeak_Paren", "Interval ",expr,
"the interval from negative infinity to positive infinity,");
}