(language: &str, speech_style: &str, test_prefs: Vec<(&str, &str)>, mathml: &str, speech: &str)
| 68 | #[allow(dead_code)] // used in testing |
| 69 | #[allow(non_snake_case)] |
| 70 | pub fn test_prefs(language: &str, speech_style: &str, test_prefs: Vec<(&str, &str)>, mathml: &str, speech: &str) { |
| 71 | set_rules_dir(abs_rules_dir_path()).unwrap(); |
| 72 | libmathcat::speech::SPEECH_RULES.with(|rules| { |
| 73 | let rules = rules.borrow_mut(); |
| 74 | let mut prefs = rules.pref_manager.borrow_mut(); |
| 75 | prefs.set_user_prefs("SpeechOverrides_CapitalLetters", ""); // makes testing simpler |
| 76 | prefs.set_user_prefs("PauseFactor", "100"); // makes testing simpler |
| 77 | prefs.set_user_prefs("Verbosity", "Medium"); |
| 78 | }); |
| 79 | |
| 80 | set_preference("Language".to_string(), language.to_string()).unwrap(); |
| 81 | set_preference("SpeechStyle".to_string(), speech_style.to_string()).unwrap(); |
| 82 | for (pref_name, pref_value) in test_prefs.clone() { |
| 83 | set_preference(pref_name.to_string(), pref_value.to_string()).unwrap(); |
| 84 | }; |
| 85 | check_answer(mathml, speech, &format!("{}/{} with prefs {:#?}", language, speech_style, test_prefs)); |
| 86 | } |
| 87 | |
| 88 | // Compare the result of speaking the mathml input to the output 'speech' |
| 89 | // This forces the use of ClearSpeak and sets a single ClearSpeak preference |
no test coverage detected