MCPcopy Create free account
hub / github.com/daisy/MathCAT / test

Function test

tests/common/mod.rs:51–64  ·  view source on GitHub ↗

used in testing

(language: &str, style: &str, mathml: &str, speech: &str)

Source from the content-addressed store, hash-verified

49// This uses default preferences
50#[allow(dead_code)] // used in testing
51pub fn test(language: &str, style: &str, mathml: &str, speech: &str) {
52 set_rules_dir(abs_rules_dir_path()).unwrap();
53 libmathcat::speech::SPEECH_RULES.with(|rules| {
54 let rules = rules.borrow_mut();
55 let mut prefs = rules.pref_manager.borrow_mut();
56 prefs.set_user_prefs("SpeechOverrides_CapitalLetters", ""); // makes testing simpler
57 prefs.set_user_prefs("PauseFactor", "100"); // makes testing simpler
58 prefs.set_user_prefs("Verbosity", "Medium");
59 });
60
61 set_preference("Language".to_string(), language.to_string()).unwrap();
62 set_preference("SpeechStyle".to_string(), style.to_string()).unwrap();
63 check_answer(mathml, speech, &format!("{}/{}", language, style));
64}
65
66// Compare the result of speaking the mathml input to the output 'speech'
67// This takes the speech style along with a vector of (pref_name, pref_value)

Callers 15

special_alphabet_charsFunction · 0.50
greekFunction · 0.50
cap_cyrillicFunction · 0.50
parenthesizedFunction · 0.50
circledFunction · 0.50
frakturFunction · 0.50
bold_frakturFunction · 0.50
double_struckFunction · 0.50
scriptFunction · 0.50
bold_scriptFunction · 0.50
boldFunction · 0.50
italicFunction · 0.50

Calls 5

set_rules_dirFunction · 0.85
set_preferenceFunction · 0.85
check_answerFunction · 0.85
set_user_prefsMethod · 0.80
abs_rules_dir_pathFunction · 0.70

Tested by 15

special_alphabet_charsFunction · 0.40
greekFunction · 0.40
cap_cyrillicFunction · 0.40
parenthesizedFunction · 0.40
circledFunction · 0.40
frakturFunction · 0.40
bold_frakturFunction · 0.40
double_struckFunction · 0.40
scriptFunction · 0.40
bold_scriptFunction · 0.40
boldFunction · 0.40
italicFunction · 0.40