Assert if result_id != '' and it doesn't match the id of the result of the move Returns the speech from the command
(command: &'static str, mathml: Element, result_id: &str)
| 834 | /// Assert if result_id != '' and it doesn't match the id of the result of the move |
| 835 | /// Returns the speech from the command |
| 836 | fn test_command(command: &'static str, mathml: Element, result_id: &str) -> String { |
| 837 | // debug!("\nCommand: {}", command); |
| 838 | NAVIGATION_STATE.with(|nav_stack| { |
| 839 | let (start_id, _) = nav_stack.borrow().get_navigation_mathml_id(mathml); |
| 840 | match do_navigate_command_string(mathml, command) { |
| 841 | Err(e) => panic!("\nStarting at '{}', '{} failed.\n{}", |
| 842 | start_id, command, &crate::interface::errors_to_string(&e)), |
| 843 | Ok(nav_speech) => { |
| 844 | // debug!("Full speech: {}", nav_speech); |
| 845 | if !result_id.is_empty() { |
| 846 | let (id, _) = nav_stack.borrow().get_navigation_mathml_id(mathml); |
| 847 | assert_eq!(result_id, id, "\nStarting at '{}', '{} failed.", start_id, command); |
| 848 | } |
| 849 | return nav_speech; |
| 850 | } |
| 851 | }; |
| 852 | }) |
| 853 | } |
| 854 | |
| 855 | fn init_default_prefs(mathml: &str, nav_mode_default: &str) { |
| 856 | set_rules_dir(super::super::abs_rules_dir_path()).unwrap(); |
no test coverage detected