/// 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("sv", "ClearSpeak", expr, "sinus av x plus cosinus av y plus tangens av z plus sekans av alfa, plus cosekans av fi, plus cotangens av fi");
}
#[test]
fn hyperbolic_trig_names() {
let expr = "";
test("sv", "ClearSpeak", expr, "sinus hyperbolicus av x, plus cosinus hyperbolicus av y, plus tangens hyperbolicus av z, plus sekans hyperbolicus av alfa, plus cosekans hyperbolicus av fi, plus cotangens hyperbolicus av fi");
}
#[test]
fn inverse_trig() {
let expr = "";
test("sv", "ClearSpeak", expr, "invers sinus av x");
}
#[test]
fn inverse_trig_trig_inverse() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Trig", "TrigInverse",expr,
"tangens invers av x");
}
#[test]
fn inverse_trig_arc() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Trig", "ArcTrig",expr,
"arc cosinus hyperbolicus av x");
}
#[test]
fn trig_squared() {
let expr = "";
test("sv", "ClearSpeak", expr, "sinus kvadrat av x");
}
#[test]
fn trig_cubed() {
let expr = "";
test("sv", "ClearSpeak", expr, "tangens kubik av x");
}
#[test]
fn trig_fourth() {
let expr = "";
test("sv", "ClearSpeak", expr, "sekans upphöjt till 4, av x");
}
#[test]
fn trig_power_other() {
let expr = "";
test("sv", "ClearSpeak", expr, "sinus hyperbolicus upphöjt till n minus 1, av x");
}
#[test]
fn simple_log() {
let expr = "";
test("sv", "ClearSpeak", expr, "logg x");
}
#[test]
fn normal_log() {
let expr = "";
test("sv", "ClearSpeak", expr, "logg, vänster-parentes; x plus y; höger-parentes");
}
#[test]
fn simple_log_with_base() {
let expr = "";
test("sv", "ClearSpeak", expr, "logaritmen med bas b av x");
}
#[test]
fn normal_log_with_base() {
let expr = "";
test("sv", "ClearSpeak", expr, "logaritmen med bas b av, vänster-parentes; x plus y; höger-parentes");
}
#[test]
fn simple_ln() {
let expr = "";
test("sv", "ClearSpeak", expr, "l n x");
}
#[test]
fn normal_ln() {
let expr = "";
test("sv", "ClearSpeak", expr, "l n, vänster-parentes; x plus y; höger-parentes");
}
#[test]
fn simple_natural_log() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Log", "LnAsNaturalLog",expr,
"naturliga logaritmen x");
}
#[test]
fn natural_log() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Log", "LnAsNaturalLog",expr,
"naturliga logaritmen, vänster-parentes; x plus y; höger-parentes");
}
#[test]
fn explicit_function_call_with_parens() {
let expr = "";
test("sv", "ClearSpeak", expr, "t av x");
}
#[test]
fn explicit_times_with_parens() {
let expr = "";
test("sv", "ClearSpeak", expr, "t gånger x");
}
#[test]
fn explicit_function_call() {
let expr = "";
test("sv", "ClearSpeak", expr, "t av x");
}
#[test]
fn explicit_times() {
let expr = "";
test("sv", "ClearSpeak", expr, "t x");
}
#[test]
fn test_functions_none_pref() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Functions", "None",expr,
"logg, vänster-parentes; x plus y; höger-parentes; plus; f gånger, vänster-parentes; x plus y; höger-parentes");
}
#[test]
fn test_functions_none_pref_multiple_args() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Functions", "None",expr,
"versal b gånger, vänster-parentes; 2 komma 6; höger-parentes");
}
/*
* Tests for times
*/
#[test]
fn no_times_binomial() {
let expr = "";
test("sv", "ClearSpeak", expr, "x y");
}
#[test]
fn times_following_paren() {
let expr = "";
test("sv", "ClearSpeak", expr, "2 gånger 3");
}
#[test]
fn times_preceding_paren() {
let expr = "";
test("sv", "ClearSpeak", expr, "2 gånger 3");
}
#[test]
fn no_times_sqrt() {
let expr = "";
test("sv", "ClearSpeak", expr, "kvadratroten ur a; kvadratroten ur b; lika med, kvadratroten ur a b,");
}
#[test]
fn more_implied_times() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_ImpliedTimes", "MoreImpliedTimes",expr,
"vänster-parentes; 2 gånger x; höger-parentes kvadrat");
}
#[test]
fn explicit_times_more_implied_times() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_ImpliedTimes", "MoreImpliedTimes",expr, "t gånger x");
}
#[test]
fn explicit_times_none_simple_right() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_ImpliedTimes", "None",
expr, "2, start hak-parentes, 3, slut hak-parentes");
}
#[test]
fn explicit_times_none_simple_left() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_ImpliedTimes", "None",
expr, "vänster-parentes; 2 minus 1; höger-parentes; x");
}
#[test]
fn explicit_times_none_superscript() {
let expr = "";
test_ClearSpeak_prefs("sv",
vec![("ClearSpeak_ImpliedTimes", "None"), ("ClearSpeak_Functions", "None")],
expr, "f, vänster-parentes, x, höger-parentes; lika med; x kvadrat, vänster-parentes; x plus 1; höger-parentes");
}
/*
* Tests for parens
*/
#[test]
fn no_parens_number() {
let expr = "";
test("sv", "ClearSpeak", expr, "25 gånger x");
}
#[test]
fn no_parens_monomial() {
let expr = "";
test("sv", "ClearSpeak", expr, "b x y");
}
#[test]
fn no_parens_negative_number() {
let expr = "";
test("sv", "ClearSpeak", expr, "2 plus minus 2");
}
#[test]
fn no_parens_negative_number_with_var() {
let expr = "";
test("sv", "ClearSpeak", expr, "minus 2 x plus 1");
}
#[test]
fn parens_superscript() {
let expr = "";
test("sv", "ClearSpeak", expr, "vänster-parentes; 2 x; höger-parentes kvadrat");
}
#[test]
fn no_parens_fraction() {
let expr = "";
test("sv", "ClearSpeak", expr, "2 plus, en halv");
}
// Tests for the ten types of intervals in ClearSpeak
#[test]
fn parens_interval_open_open() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Paren", "Interval",expr,
"det öppna intervallet från c till d");
}
#[test]
fn parens_interval_closed_open() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Paren", "Interval ",expr,
"det halvöppna intervallet från och med c till d");
}
#[test]
fn parens_interval_open_closed() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Paren", "Interval ",expr,
"det halvöppna intervallet från c till och med d");
}
#[test]
fn parens_interval_closed_closed() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Paren", "Interval ",expr,
"det slutna intervallet från c till d");
}
#[test]
fn parens_interval_neg_infinity_open_open() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Paren", "Interval ",expr,
"det öppna intervallet från minus oändligheten till d");
}
#[test]
fn parens_interval_neg_infinity_closed_open() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Paren", "Interval ",expr,
"det halvöppna intervallet från minus oändligheten till och med d");
}
#[test]
fn parens_interval_open_open_infinity() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Paren", "Interval ",expr,
"det öppna intervallet från c till oändligheten");
}
#[test]
fn parens_interval_closed_open_infinity() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Paren", "Interval ",expr,
"det halvöppna intervallet från och med c till oändligheten");
}
#[test]
fn parens_interval_neg_infinity_to_infinity() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Paren", "Interval ",expr,
"det öppna intervallet från minus oändligheten till oändligheten");
}
#[test]
fn parens_interval_neg_infinity_to_pos_infinity() {
let expr = "";
test_ClearSpeak("sv", "ClearSpeak_Paren", "Interval ",expr,
"det öppna intervallet från minus oändligheten till plus oändligheten");
}