comparison 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
comparison
equal deleted inserted replaced
27399:53c64ca1c4f3 27400:722db0819111
1338 gui_send_mouse_event(button, TEXT_X(col - 1), TEXT_Y(row - 1), repeated_click, mods); 1338 gui_send_mouse_event(button, TEXT_X(col - 1), TEXT_Y(row - 1), repeated_click, mods);
1339 # endif 1339 # endif
1340 } 1340 }
1341 1341
1342 void 1342 void
1343 f_test_gui_tabline_event(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
1344 {
1345 # ifdef FEAT_GUI
1346 int tabnr;
1347
1348 if (check_for_number_arg(argvars, 0) == FAIL)
1349 return;
1350
1351 tabnr = tv_get_number(&argvars[0]);
1352
1353 rettv->v_type = VAR_BOOL;
1354 rettv->vval.v_number = send_tabline_event(tabnr);
1355 # endif
1356 }
1357
1358 void
1359 f_test_gui_tabmenu_event(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
1360 {
1361 # ifdef FEAT_GUI
1362 int tabnr;
1363 int event;
1364
1365 if (check_for_number_arg(argvars, 0) == FAIL
1366 || check_for_number_arg(argvars, 1) == FAIL)
1367 return;
1368
1369 tabnr = tv_get_number(&argvars[0]);
1370 event = tv_get_number(&argvars[1]);
1371
1372 send_tabline_menu_event(tabnr, event);
1373 # endif
1374 }
1375
1376 void
1343 f_test_settime(typval_T *argvars, typval_T *rettv UNUSED) 1377 f_test_settime(typval_T *argvars, typval_T *rettv UNUSED)
1344 { 1378 {
1345 if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL) 1379 if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
1346 return; 1380 return;
1347 1381