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

Function zoom_out

src/navigate.rs:989–1013  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

987
988 #[test]
989 fn zoom_out() -> Result<()> {
990 let mathml_str = "<math id='math'><mfrac id='mfrac'>
991 <msup id='msup'><mi id='base'>b</mi><mn id='exp'>2</mn></msup>
992 <mi id='denom'>d</mi>
993 </mfrac></math>";
994 init_default_prefs(mathml_str, "Enhanced");
995 return MATHML_INSTANCE.with(|package_instance| {
996 let package_instance = package_instance.borrow();
997 let mathml = get_element(&*package_instance);
998 NAVIGATION_STATE.with(|nav_stack| {
999 nav_stack.borrow_mut().push(NavigationPosition{
1000 current_node: "base".to_string(),
1001 current_node_offset: 0
1002 }, "None")
1003 });
1004 test_command("ZoomOut", mathml, "msup");
1005
1006 let _nav_speech = do_navigate_command_and_param(mathml, NavigationCommand::Zoom, NavigationParam::Previous)?;
1007 NAVIGATION_STATE.with(|nav_stack| {
1008 let (id, _) = nav_stack.borrow().get_navigation_mathml_id(mathml);
1009 assert_eq!(id, "mfrac");
1010 });
1011 return Ok( () );
1012 });
1013 }
1014
1015 #[test]
1016 fn zoom_out_all() -> Result<()> {

Callers

nothing calls this directly

Calls 6

init_default_prefsFunction · 0.85
get_elementFunction · 0.85
test_commandFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected