/// Tests for rules shared between various speech styles:
/// * modified var
use crate::common::*;
#[test]
fn salt() {
let expr = "";
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "versal n a, versal c l,");
}
#[test]
fn water() {
let expr = "";
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Terse")], expr, "versal h, 2 versal o,");
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Medium")], expr, "versal h, nedsänkt 2, versal o,");
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Verbose")], expr, "versal h, nedre index 2, versal o,");
}
#[test]
fn carbon() {
let expr = ""; // not enough to trigger recognition
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "versal c");
}
#[test]
fn sulfate() {
let expr = "";
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Medium")], expr, "start hak-parentes; versal s, versal o, nedsänkt 4; slut hak-parentes upphöjt 2 minus");
}
#[test]
fn aluminum_sulfate() {
let expr = "";
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Terse")], expr, "versal a l, 2; start-parentes; versal s, versal o, 4; slut-parentes 3");
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Medium")], expr, "versal a l, nedsänkt 2; vänster-parentes; versal s, versal o, nedsänkt 4; höger-parentes nedsänkt 3");
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Verbose")], expr, "versal a l, nedre index 2; vänster-parentes; versal s, versal o, nedre index 4; höger-parentes nedre index 3");
}
#[test]
fn ethanol_bonds() {
let expr = "";
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Terse")], expr, "versal c, versal h, 3 enkelbindning versal c, versal h, 2 enkelbindning versal o, versal h,");
}
#[test]
fn dichlorine_hexoxide() {
let expr = "";
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Terse")],
expr, "start hak-parentes; versal c l, versal o, 2; slut hak-parentes plus; start hak-parentes; versal c l, versal o, 4; slut hak-parentes minus");
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Medium")],
expr, "start hak-parentes; versal c l, versal o, nedsänkt 2; slut hak-parentes upphöjt plus; start hak-parentes; versal c l, versal o, nedsänkt 4; slut hak-parentes upphöjt minus");
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Verbose")],
expr, "start hak-parentes; versal c l, versal o, nedre index 2; slut hak-parentes övre index plus; start hak-parentes; versal c l, versal o, nedre index 4; slut hak-parentes övre index minus");
}
#[test]
fn ethylene_with_bond() {
let expr = "";
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "versal h, 2 versal c, dubbelbindning versal c, versal h, 2");
}
#[test]
fn ferric_chloride_aq() {
let expr = "";
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "versal f e, versal c l, 3 vattenlösning,");
}
#[test]
fn ethylene_with_colon_bond() {
let expr = "";
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "versal h, 2 versal c, dubbelbindning versal c, versal h, 2");
}
#[test]
fn beta_decay() {
let expr = "";
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Terse")], expr,
"14, 6, versal c; bildar, 14, 7, versal n; plus 0, minus 1, e,");
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Medium")], expr,
"upphöjt 14, nedsänkt 6, versal c; reaktion bildar; upphöjt 14, nedsänkt 7, versal n; plus, upphöjt 0, nedsänkt minus 1, e,");
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Verbose")], expr,
"övre index 14, nedre index 6, versal c; reaktion bildar; övre index 14, nedre index 7, versal n; plus, övre index 0, nedre index minus 1, e,");
}
#[test]
fn mhchem_beta_decay() {
let expr = "";
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Terse")], expr,
"14, 6, versal c; bildar, 14, 7, versal n; plus 0, minus 1, e,");
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Medium")], expr,
"upphöjt 14, nedsänkt 6, versal c; reaktion bildar; upphöjt 14, nedsänkt 7, versal n; plus, upphöjt 0, nedsänkt minus 1, e,");
test_prefs("sv", "ClearSpeak", vec![("Verbosity", "Verbose")], expr,
"övre index 14, nedre index 6, versal c; reaktion bildar; övre index 14, nedre index 7, versal n; plus, övre index 0, nedre index minus 1, e,");
}
#[test]
fn hcl_na_yields() {
let expr = "";
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr,
"2, versal h, versal c l; plus 2 versal n a; reaktion bildar; 2, versal n a, versal c l; plus versal h, nedre index 2");
}
#[test]
fn mhchem_so4_2plus() {
let expr = "";
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "versal s; versal o, 4, 2 plus,");
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Medium")], expr, "versal s; versal o, nedsänkt 4, upphöjt 2 plus,");
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "versal s; versal o, nedre index 4, övre index 2 plus,");
}
#[test]
fn mhchem_hcl_aq_etc() {
let expr = "";
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Terse")],
expr, "2, versal h, versal c l, vattenlösning; plus, 2, versal n a, fast; bildar; 2, versal n a, versal c l, vattenlösning; plus, versal h, 2; gas,");
}
#[test]
fn mhchem_barbed_equilibrium() {
let expr = "";
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Terse")],
expr, "versal h, 2; gas; plus; versal i, 2; gas; är i jämvikt med 2, versal h, versal i, gas,");
}
#[test]
fn mhchem_roman_in_superscript() {
let expr = "";
test_prefs("sv", "SimpleSpeak", vec![("Verbosity", "Terse")],
expr, "versal f e, 2; versal f e, 3; versal o, 4,");
}