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

Function test_command

src/navigate.rs:836–853  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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();

Callers 15

zoom_inFunction · 0.85
zoom_in_parensFunction · 0.85
zoom_in_allFunction · 0.85
zoom_outFunction · 0.85
zoom_out_allFunction · 0.85
move_start_endFunction · 0.85
move_line_start_endFunction · 0.85
move_to_startFunction · 0.85
move_right_supFunction · 0.85
move_right_charFunction · 0.85

Calls 3

is_emptyMethod · 0.80

Tested by

no test coverage detected