diff src/testing.c @ 27400:722db0819111 v8.2.4228

patch 8.2.4228: no tests for clicking in the GUI tabline Commit: https://github.com/vim/vim/commit/b0ad2d92fd19e673ddbbc66742bae3f71778efde Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu Jan 27 13:16:59 2022 +0000 patch 8.2.4228: no tests for clicking in the GUI tabline Problem: No tests for clicking in the GUI tabline. Solution: Add test functions to generate the events. Add tests using the functions. (Yegappan Lakshmanan, closes #9638)
author Bram Moolenaar <Bram@vim.org>
date Thu, 27 Jan 2022 14:30:04 +0100
parents 68c33419fdc6
children 557a50b0d10b
line wrap: on
line diff
--- a/src/testing.c
+++ b/src/testing.c
@@ -1340,6 +1340,40 @@ f_test_gui_mouse_event(typval_T *argvars
 }
 
     void
+f_test_gui_tabline_event(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
+{
+# ifdef FEAT_GUI
+    int	tabnr;
+
+    if (check_for_number_arg(argvars, 0) == FAIL)
+	return;
+
+    tabnr = tv_get_number(&argvars[0]);
+
+    rettv->v_type = VAR_BOOL;
+    rettv->vval.v_number = send_tabline_event(tabnr);
+# endif
+}
+
+    void
+f_test_gui_tabmenu_event(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
+{
+# ifdef FEAT_GUI
+    int	tabnr;
+    int	event;
+
+    if (check_for_number_arg(argvars, 0) == FAIL
+	    || check_for_number_arg(argvars, 1) == FAIL)
+	return;
+
+    tabnr = tv_get_number(&argvars[0]);
+    event = tv_get_number(&argvars[1]);
+
+    send_tabline_menu_event(tabnr, event);
+# endif
+}
+
+    void
 f_test_settime(typval_T *argvars, typval_T *rettv UNUSED)
 {
     if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)