used in testing
(test: &str, target: &str, failure_message: &str)
| 36 | |
| 37 | #[allow(dead_code)] // used in testing |
| 38 | fn check_answer(test: &str, target: &str, failure_message: &str) { |
| 39 | if let Err(e) = set_mathml(test.to_string()) { |
| 40 | panic!("{}", errors_to_string(&e)); |
| 41 | }; |
| 42 | match get_spoken_text() { |
| 43 | Ok(speech) => assert_eq!(target, strip_spaces(speech), "\ntest with {} failed", failure_message), |
| 44 | Err(e) => panic!("{}", errors_to_string(&e)), |
| 45 | }; |
| 46 | } |
| 47 | |
| 48 | // Compare the result of speaking the mathml input to the output 'speech' |
| 49 | // This uses default preferences |