/// Tests for rules shared between various speech styles:
/// * modified var
use crate::common::*;
#[test]
fn modified_vars() {
let expr = "";
test("en", "SimpleSpeak", expr,
"eigh grave, b tilde, c breve, b check, c grave; plus; \
x dot, y dot, z double dot, u triple dot, v quadruple dot; plus x hat, plus vector t");
}
#[test]
fn limit() {
let expr = "";
test("en", "SimpleSpeak", expr, "the limit as x approaches 0, of, fraction, sine of x, over x, end fraction;");
test_prefs("en", "SimpleSpeak", vec![("Impairment", "LearningDisability")], expr,
"the limit as x approaches 0, of; sine of x, over x;");
}
#[test]
fn limit_from_below() {
let expr = "";
test("en", "SimpleSpeak", expr, "the limit as x approaches from below 0, of sine of x");
}
#[test]
fn binomial_mmultiscripts() {
let expr = "";
test("en", "SimpleSpeak", expr, "n choose m");
}
#[test]
fn binomial_mmultiscripts_other() {
let expr = "";
test("en", "SimpleSpeak", expr, "n choose m");
}
#[test]
fn binomial_subscript() { // C_{n,k}
let expr = "";
test("en", "SimpleSpeak", expr, "n choose m");
}
#[test]
fn permutation_mmultiscripts() {
let expr = "";
test("en", "SimpleSpeak", expr, "k permutations of n");
}
#[test]
fn permutation_mmultiscripts_sup() {
let expr = "";
test("en", "SimpleSpeak", expr, "k permutations of n");
}
#[test]
fn permutation_msubsup() {
let expr = "";
test("en", "SimpleSpeak", expr, "k permutations of n");
}
#[test]
fn tensor_mmultiscripts() {
let expr = "";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr,
"cap r with 4 postscripts, subscript i superscript j subscript k subscript l");
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Medium")], expr,
"cap r with 4 postscripts, sub i super j sub k sub l");
}
#[test]
fn huge_num_mmultiscripts() {
let expr = "";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr,
"cap r with 4 prescripts, pre subscript cap i, pre superscript cap j and alternating prescripts cap k none cap l none end prescripts and with 5 postscripts, subscript i superscript j subscript k subscript l and alternating scripts m none end scripts");
}
#[test]
fn prime() {
let expr = "";
test("en", "SimpleSpeak", expr, "x prime,");
}
#[test]
fn given() {
let expr = "";
test("en", "SimpleSpeak", expr, "cap p, open paren, cap eigh given cap b, close paren");
test("en", "ClearSpeak", expr, "cap p, open paren, cap eigh given cap b, close paren"); // not good, but follows the spec
}
#[test]
fn simple_msubsup() {
let expr = "";
test("en", "ClearSpeak", expr, "x sub k, to the i-th power");
}
#[test]
fn non_simple_msubsup() {
let expr = "";
test("en", "SimpleSpeak", expr, "i sub j minus 2 end sub, to the k-th");
test("en", "ClearSpeak", expr, "i sub j minus 2 end sub, to the k-th power");
test_prefs("en", "SimpleSpeak", vec![("Impairment", "LearningDisability")], expr,
"i sub j minus 2, to the k-th");
}
#[test]
fn presentation_mathml_in_semantics() {
let expr = "";
test("en", "ClearSpeak", expr, "x sub k, to the i-th power");
}
#[test]
fn ignore_period() {
// from https://en.wikipedia.org/wiki/Probability
let expr = "";
test("en", "SimpleSpeak", expr, "cap p; open paren, cap eigh and cap b; close paren; is equal to; cap p, open paren, cap eigh intersection cap b; close paren; is equal to, cap p of cap eigh, cap p of cap b");
}
#[test]
fn ignore_mtext_period() {
let expr = "";
test("en", "SimpleSpeak", expr, "the set 2");
}
#[test]
fn ignore_comma() {
// from https://en.wikipedia.org/wiki/Probability
let expr = "";
test("en", "SimpleSpeak", expr, "phi of x is equal to; c, e raised to the negative h squared x squared power,");
}
#[test]
#[ignore] // issue #14
fn ignore_period_and_space() {
// from https://en.wikipedia.org/wiki/Probability
let expr = "";
test("en", "ClearSpeak", expr, "phi of x is equal to; c, e raised to the negative h squared x squared power");
}
#[test]
fn bug_199_2pi() {
let expr = "";
test("en", "SimpleSpeak",expr, "the closed open interval from 0 to 2 pi");
}
#[test]
fn caret_and_hat() {
let expr = "";
test("en", "SimpleSpeak",expr, "x caret 2 plus y hat,");
}
#[test]
fn mn_with_space() {
let expr = "";
test_prefs("en", "SimpleSpeak", vec![("DecimalSeparators", "."), ("BlockSeparators", " ,")], expr, "1234567");
}
#[test]
fn mn_with_block_and_decimal_separators() {
let expr = ""; // may want to change this for another language
test_prefs("en", "SimpleSpeak", vec![("DecimalSeparators", "."), ("BlockSeparators", " ,")], expr, "1234.56");
}
#[test]
fn divergence() {
let expr = ""; // may want to change this for another language
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "div of cap f");
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "divergence of cap f");
}
#[test]
fn curl() {
let expr = "";
// may want to change this for another language
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "curl of cap f");
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "curl of cap f");
}
#[test]
fn gradient() {
let expr = "";
// may want to change this for another language
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "del cap f");
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "gradient of cap f");
}