/// Tests for rules shared between various speech styles:
/// * modified var
use crate::common::*;
#[test]
fn salt() {
let expr = "";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "cap n eigh, cap c l,");
}
#[test]
fn water() {
let expr = "";
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Terse")], expr, "cap h, 2 cap o,");
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Medium")], expr, "cap h, sub 2 cap o,");
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Verbose")], expr, "cap h, subscript 2, cap o,");
}
#[test]
fn carbon() {
let expr = ""; // not enough to trigger recognition
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "cap c");
}
#[test]
fn sulfate() {
let expr = "";
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Medium")], expr, "open bracket, cap s, cap o, sub 4; close bracket super 2 minus");
}
#[test]
fn aluminum_sulfate() {
let expr = "";
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Terse")], expr, "cap eigh l, 2, open cap s, cap o, 4, close 3");
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Medium")], expr, "cap eigh l, sub 2; open paren, cap s, cap o, sub 4; close paren sub 3");
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Verbose")], expr, "cap eigh l, subscript 2; open paren, cap s, cap o, subscript 4; close paren subscript 3");
}
#[test]
fn ethanol_bonds() {
let expr = "";
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Terse")], expr, "cap c, cap h, 3 single bond cap c, cap h, 2 single bond cap o, cap h,");
}
#[test]
fn dichlorine_hexoxide() {
let expr = "";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")],
expr, "open bracket, cap c l, cap o, 2, close bracket plus; \
open bracket, cap c l, cap o, 4, close bracket minus");
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Medium")],
expr, "open bracket, cap c l, cap o, sub 2; close bracket super plus; \
open bracket, cap c l, cap o, sub 4; close bracket super minus");
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")],
expr, "open bracket, cap c l, cap o, subscript 2; close bracket superscript plus; \
open bracket, cap c l, cap o, subscript 4; close bracket superscript minus");
}
#[test]
fn ethylene_with_bond() {
let expr = "";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "cap h, 2 cap c, double bond cap c, cap h, 2");
}
#[test]
fn ferric_chloride_aq() {
let expr = "";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "cap f e, cap c l, 3 aqueous,");
}
#[test]
fn ethylene_with_colon_bond() {
let expr = "";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "cap h, 2 cap c, double bond cap c, cap h, 2");
}
#[test]
fn beta_decay() {
let expr = "";
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Terse")], expr,
"14, 6, cap c; forms, 14, 7, cap n; plus 0, negative 1, e,");
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Medium")], expr,
"super 14, sub 6, cap c; reacts to form; super 14, sub 7, cap n; plus super 0, sub negative 1, e,");
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Verbose")], expr,
"superscript 14, subscript 6, cap c; reacts to form; superscript 14, subscript 7, cap n; plus, superscript 0, subscript negative 1, e,");
}
#[test]
fn mhchem_beta_decay() {
let expr = "";
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Terse")], expr,
"14, 6, cap c; forms, 14, 7, cap n; plus 0, negative 1, e,");
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Medium")], expr,
"super 14, sub 6, cap c; reacts to form; super 14, sub 7, cap n; plus super 0, sub negative 1, e,");
test_prefs("en", "ClearSpeak", vec![("Verbosity", "Verbose")], expr,
"superscript 14, subscript 6, cap c; reacts to form; superscript 14, subscript 7, cap n; plus, superscript 0, subscript negative 1, e,");
}
#[test]
fn hcl_na_yields() {
let expr = "";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr,
"2, cap h, cap c l; plus 2 cap n eigh; reacts to form; 2, cap n eigh, cap c l; plus cap h, subscript 2");
}
#[test]
fn mhchem_so4_2plus() {
let expr = "";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "cap s; cap o, 4, 2 plus,");
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Medium")], expr, "cap s; cap o, sub 4, super 2 plus,");
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "cap s; cap o, subscript 4, superscript 2 plus,");
}
#[test]
fn mhchem_hcl_aq_etc() {
let expr = "";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")],
expr, "2, cap h, cap c l, aqueous; plus, 2, cap n eigh, solid; forms; 2, cap n eigh, cap c l, aqueous; plus, cap h, 2, gas,");
}
#[test]
fn mhchem_barbed_equilibrium() {
let expr = "";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")],
expr, "cap h, 2, gas; plus; cap i, 2, gas; is in equilibrium with, 2, cap h, cap i, gas,");
}
#[test]
fn mhchem_roman_in_superscript() {
let expr = " ";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")],
expr, "cap f e, 2; cap f e, 3; cap o, 4,");
}