+let test_set_selection mathview () =
+ begin
+ match mathview#get_selection with
+ Some element ->
+ begin
+ match element#get_parentNode with
+ Some p ->
+ begin
+ try
+ mathview#set_selection (Some (new Gdome.element_of_node p));
+ print_string "set selection: SEEMS TO WORK\n"
+ with
+ GdomeInit.DOMCastException _ ->
+ print_string "EXCEPTION: no parent\n"
+ end
+ | None -> assert false (* every element has a parent *)
+ end
+ | None ->
+ mathview#set_selection None;
+ print_string "no selection\n"
+ end ;
+ flush stdout
+;;
+
+let test_add_selection (mathview : GMathViewAux.multi_selection_math_view) () =
+ match mathview#get_selection with
+ Some e -> mathview#add_selection e
+ | None ->
+ begin
+ print_string "no selection to add\n" ;
+ flush stdout
+ end
+;;
+
+let test_reset_selections (mathview : GMathViewAux.multi_selection_math_view) () =
+ mathview#set_selection None ;
+ mathview#remove_selections
+