Mercurial > vim
annotate runtime/doc/testing.txt @ 32132:059e89bf9316 v9.0.1397
patch 9.0.1397: highlight for popupmenu kind and extra cannot be set
Commit: https://github.com/vim/vim/commit/6a7c7749204b256e779c245b1e999bf852ad7b64
Author: Gianmaria Bajo <mg1979.git@gmail.com>
Date: Fri Mar 10 16:35:53 2023 +0000
patch 9.0.1397: highlight for popupmenu kind and extra cannot be set
Problem: Highlight for popupmenu kind and extra cannot be set.
Solution: Add PmenuKind, PmenuKindSel, PmenuExtra and PmenuExtraSel
highlight groups and use them. (Gianmaria Bajo, closes #12114)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 10 Mar 2023 17:45:05 +0100 |
parents | a9b5ffbc0428 |
children | 2a17771529af |
rev | line source |
---|---|
31579 | 1 *testing.txt* For Vim version 9.0. Last change: 2022 Dec 30 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 VIM REFERENCE MANUAL by Bram Moolenaar |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 Testing Vim and Vim script *testing-support* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 Expression evaluation is explained in |eval.txt|. This file goes into details |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 about writing tests in Vim script. This can be used for testing Vim itself |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 and for testing plugins. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 1. Testing Vim |testing| |
17571 | 14 2. Test functions |test-functions-details| |
15 3. Assert functions |assert-functions-details| | |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 ============================================================================== |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 1. Testing Vim *testing* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 Vim can be tested after building it, usually with "make test". |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 The tests are located in the directory "src/testdir". |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 |
21779
30bdd2e4a6f9
patch 8.2.1439: tiny and small builds have no test coverage
Bram Moolenaar <Bram@vim.org>
parents:
21741
diff
changeset
|
23 There are two types of tests added over time: |
30bdd2e4a6f9
patch 8.2.1439: tiny and small builds have no test coverage
Bram Moolenaar <Bram@vim.org>
parents:
21741
diff
changeset
|
24 test20.in oldest, only for tiny and small builds |
30bdd2e4a6f9
patch 8.2.1439: tiny and small builds have no test coverage
Bram Moolenaar <Bram@vim.org>
parents:
21741
diff
changeset
|
25 test_something.vim new style tests |
30bdd2e4a6f9
patch 8.2.1439: tiny and small builds have no test coverage
Bram Moolenaar <Bram@vim.org>
parents:
21741
diff
changeset
|
26 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
27 *new-style-testing* |
21741
baccf9e06efe
patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents:
21499
diff
changeset
|
28 New tests should be added as new style tests. The test scripts are named |
baccf9e06efe
patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents:
21499
diff
changeset
|
29 test_<feature>.vim (replace <feature> with the feature under test). These use |
baccf9e06efe
patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents:
21499
diff
changeset
|
30 functions such as |assert_equal()| to keep the test commands and the expected |
baccf9e06efe
patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents:
21499
diff
changeset
|
31 result in one place. |
21779
30bdd2e4a6f9
patch 8.2.1439: tiny and small builds have no test coverage
Bram Moolenaar <Bram@vim.org>
parents:
21741
diff
changeset
|
32 *old-style-testing* |
30bdd2e4a6f9
patch 8.2.1439: tiny and small builds have no test coverage
Bram Moolenaar <Bram@vim.org>
parents:
21741
diff
changeset
|
33 These tests are used only for testing Vim without the |+eval| feature. |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 Find more information in the file src/testdir/README.txt. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 ============================================================================== |
17571 | 38 2. Test functions *test-functions-details* |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
41 This is for testing: If the memory allocation with {id} is |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
42 called, then decrement {countdown}, and when it reaches zero |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
43 let memory allocation fail {repeat} times. When {repeat} is |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
44 smaller than one it fails one time. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
45 |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
46 Can also be used as a |method|: > |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
47 GetAllocId()->test_alloc_fail() |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
48 |
25700 | 49 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
50 test_autochdir() *test_autochdir()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
51 Set a flag to enable the effect of 'autochdir' before Vim |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
52 startup has finished. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
53 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
54 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
55 test_feedinput({string}) *test_feedinput()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
56 Characters in {string} are queued for processing as if they |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
57 were typed by the user. This uses a low level input buffer. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
58 This function works only when with |+unix| or GUI is running. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
59 |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
60 Can also be used as a |method|: > |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
61 GetText()->test_feedinput() |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
62 |
25700 | 63 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
64 test_garbagecollect_now() *test_garbagecollect_now()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
65 Like garbagecollect(), but executed right away. This must |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
66 only be called directly to avoid any structure to exist |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
67 internally, and |v:testing| must have been set before calling |
27537 | 68 any function. *E1142* |
69 This will not work when called from a :def function, because | |
70 variables on the stack will be freed. | |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
71 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
72 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
73 test_garbagecollect_soon() *test_garbagecollect_soon()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
74 Set the flag to call the garbagecollector as if in the main |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
75 loop. Only to be used in tests. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
76 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
77 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
78 test_getvalue({name}) *test_getvalue()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
79 Get the value of an internal variable. These values for |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
80 {name} are supported: |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
81 need_fileinfo |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
82 |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
83 Can also be used as a |method|: > |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
84 GetName()->test_getvalue() |
24982
4cb423b9250d
patch 8.2.3028: GUI mouse events not tested
Bram Moolenaar <Bram@vim.org>
parents:
24387
diff
changeset
|
85 < |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
86 *test_gui_event()* |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
87 test_gui_event({event}, {args}) |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
88 Generate a GUI {event} with arguments {args} for testing Vim |
27470
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
89 functionality. This function works only when the GUI is |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
90 running. |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
91 |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
92 {event} is a String and the supported values are: |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
93 "dropfiles" drop one or more files in a window. |
29290 | 94 "findrepl" search and replace text. |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
95 "mouse" mouse button click event. |
29290 | 96 "scrollbar" move or drag the scrollbar. |
31503
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
97 "key" send a low-level keyboard event. |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
98 "tabline" select a tab page by mouse click. |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
99 "tabmenu" select a tabline menu entry. |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
100 |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
101 {args} is a Dict and contains the arguments for the event. |
25973 | 102 |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
103 "dropfiles": |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
104 Drop one or more files in a specified window. The supported |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
105 items in {args} are: |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
106 files: List of file names |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
107 row: window row number |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
108 col: window column number |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
109 modifiers: key modifiers. The supported values are: |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
110 0x4 Shift |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
111 0x8 Alt |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
112 0x10 Ctrl |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
113 The files are added to the |argument-list| and the first |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
114 file in {files} is edited in the window. See |drag-n-drop| |
27470
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
115 for more information. This event works only when the |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
116 |drop_file| feature is present. |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
117 |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
118 "findrepl": |
27537 | 119 {only available when the GUI has a find/replace dialog} |
27470
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
120 Perform a search and replace of text. The supported items |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
121 in {args} are: |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
122 find_text: string to find. |
29290 | 123 repl_text: replacement string. |
27470
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
124 flags: flags controlling the find/replace. Supported |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
125 values are: |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
126 1 search next string (find dialog) |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
127 2 search next string (replace dialog) |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
128 3 replace string once |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
129 4 replace all matches |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
130 8 match whole words only |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
131 16 match case |
f0096e5b3df9
patch 8.2.4263: no test for the GUI find/replace dialog
Bram Moolenaar <Bram@vim.org>
parents:
27462
diff
changeset
|
132 forward: set to 1 for forward search. |
25006
496221916885
patch 8.2.3040: GUI: dropping files not tested
Bram Moolenaar <Bram@vim.org>
parents:
24982
diff
changeset
|
133 |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
134 "mouse": |
28297
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
135 Inject either a mouse button click, or a mouse move, event. |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
136 The supported items in {args} are: |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
137 button: mouse button. The supported values are: |
31383 | 138 0 left mouse button |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
139 1 middle mouse button |
31383 | 140 2 right mouse button |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
141 3 mouse button release |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
142 4 scroll wheel down |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
143 5 scroll wheel up |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
144 6 scroll wheel left |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
145 7 scroll wheel right |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
146 row: mouse click row number. The first row of the |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
147 Vim window is 1 and the last row is 'lines'. |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
148 col: mouse click column number. The maximum value |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
149 of {col} is 'columns'. |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
150 multiclick: set to 1 to inject a multiclick mouse event. |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
151 modifiers: key modifiers. The supported values are: |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
152 4 shift is pressed |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
153 8 alt is pressed |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
154 16 ctrl is pressed |
28297
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
155 move: Optional; if used and TRUE then a mouse move |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
156 event can be generated. |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
157 Only {args} row: and col: are used and |
28885
947b7d061b07
patch 8.2.4965: GUI: testing mouse move event depends on screen cell size
Bram Moolenaar <Bram@vim.org>
parents:
28379
diff
changeset
|
158 required; they are interpreted as pixels or |
947b7d061b07
patch 8.2.4965: GUI: testing mouse move event depends on screen cell size
Bram Moolenaar <Bram@vim.org>
parents:
28379
diff
changeset
|
159 screen cells, depending on "cell". |
28297
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
160 Only results in an event when 'mousemoveevent' |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
161 is set or a popup uses mouse move events. |
28885
947b7d061b07
patch 8.2.4965: GUI: testing mouse move event depends on screen cell size
Bram Moolenaar <Bram@vim.org>
parents:
28379
diff
changeset
|
162 cell: Optional: when present and TRUE then "move" |
947b7d061b07
patch 8.2.4965: GUI: testing mouse move event depends on screen cell size
Bram Moolenaar <Bram@vim.org>
parents:
28379
diff
changeset
|
163 uses screen cells instead of pixel positions |
28297
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
164 |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
165 "scrollbar": |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
166 Set or drag the left, right or horizontal scrollbar. Only |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
167 works when the scrollbar actually exists. The supported |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
168 items in {args} are: |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
169 which: scrollbar. The supported values are: |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
170 left Left scrollbar of the current window |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
171 right Right scrollbar of the current window |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
172 hor Horizontal scrollbar |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
173 value: amount to scroll. For the vertical scrollbars |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
174 the value can be 1 to the line-count of the |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
175 buffer. For the horizontal scrollbar the |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
176 value can be between 1 and the maximum line |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
177 length, assuming 'wrap' is not set. |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
178 dragging: 1 to drag the scrollbar and 0 to click in the |
4190b932e6ca
patch 8.2.4674: cannot force getting MouseMove events
Bram Moolenaar <Bram@vim.org>
parents:
27634
diff
changeset
|
179 scrollbar. |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
180 |
31503
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
181 "key": |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
182 Send a low-level keyboard event (e.g. key-up or down). |
29432
339fe2968690
patch 9.0.0058: Win32: cannot test low level events
Bram Moolenaar <Bram@vim.org>
parents:
29340
diff
changeset
|
183 Currently only supported on MS-Windows. |
339fe2968690
patch 9.0.0058: Win32: cannot test low level events
Bram Moolenaar <Bram@vim.org>
parents:
29340
diff
changeset
|
184 The supported items in {args} are: |
339fe2968690
patch 9.0.0058: Win32: cannot test low level events
Bram Moolenaar <Bram@vim.org>
parents:
29340
diff
changeset
|
185 event: The supported string values are: |
339fe2968690
patch 9.0.0058: Win32: cannot test low level events
Bram Moolenaar <Bram@vim.org>
parents:
29340
diff
changeset
|
186 keyup generate a keyup event |
339fe2968690
patch 9.0.0058: Win32: cannot test low level events
Bram Moolenaar <Bram@vim.org>
parents:
29340
diff
changeset
|
187 keydown generate a keydown event |
339fe2968690
patch 9.0.0058: Win32: cannot test low level events
Bram Moolenaar <Bram@vim.org>
parents:
29340
diff
changeset
|
188 keycode: Keycode to use for a keyup or a keydown event. |
29533 | 189 *E1291* |
29432
339fe2968690
patch 9.0.0058: Win32: cannot test low level events
Bram Moolenaar <Bram@vim.org>
parents:
29340
diff
changeset
|
190 |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
191 "tabline": |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
192 Inject a mouse click event on the tabline to select a |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
193 tabpage. The supported items in {args} are: |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
194 tabnr: tab page number |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
195 |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
196 "tabmenu": |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
197 Inject an event to select a tabline menu entry. The |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
198 supported items in {args} are: |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
199 tabnr: tab page number |
32004 | 200 item: tab page menu item number. 1 for the first |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
201 menu item, 2 for the second item and so on. |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
202 |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
203 After injecting the GUI events you probably should call |
24982
4cb423b9250d
patch 8.2.3028: GUI mouse events not tested
Bram Moolenaar <Bram@vim.org>
parents:
24387
diff
changeset
|
204 |feedkeys()| to have them processed, e.g.: > |
4cb423b9250d
patch 8.2.3028: GUI mouse events not tested
Bram Moolenaar <Bram@vim.org>
parents:
24387
diff
changeset
|
205 call feedkeys("y", 'Lx!') |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
206 < |
27400
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27321
diff
changeset
|
207 Returns TRUE if the event is successfully added, FALSE if |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
208 there is a failure. |
27400
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27321
diff
changeset
|
209 |
27462
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
210 Can also be used as a |method|: > |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
211 GetEvent()->test_gui_event({args}) |
b43f6c879d52
patch 8.2.4259: number of test functions for GUI events is growing
Bram Moolenaar <Bram@vim.org>
parents:
27459
diff
changeset
|
212 < |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
213 test_ignore_error({expr}) *test_ignore_error()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
214 Ignore any error containing {expr}. A normal message is given |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
215 instead. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
216 This is only meant to be used in tests, where catching the |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
217 error with try/catch cannot be used (because it skips over |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
218 following code). |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
219 {expr} is used literally, not as a pattern. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
220 When the {expr} is the string "RESET" then the list of ignored |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
221 errors is made empty. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
222 |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
223 Can also be used as a |method|: > |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
224 GetErrorText()->test_ignore_error() |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
225 |
31885 | 226 |
31503
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
227 test_mswin_event({event}, {args}) *test_mswin_event()* |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
228 Generate a low-level MS-Windows {event} with arguments {args} |
31885 | 229 for testing Vim functionality. It works for MS-Windows GUI |
31503
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
230 and for the console. |
31885 | 231 |
31503
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
232 {event} is a String and the supported values are: |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
233 "mouse" mouse event. |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
234 "key" keyboard event. |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
235 |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
236 "mouse": |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
237 Inject either a mouse button click, or a mouse move, event. |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
238 The supported items in {args} are: |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
239 button: mouse button. The supported values are: |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
240 0 right mouse button |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
241 1 middle mouse button |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
242 2 left mouse button |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
243 3 mouse button release |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
244 4 scroll wheel down |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
245 5 scroll wheel up |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
246 6 scroll wheel left |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
247 7 scroll wheel right |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
248 row: mouse click row number. The first row of the |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
249 Vim window is 1 and the last row is 'lines'. |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
250 col: mouse click column number. The maximum value |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
251 of {col} is 'columns'. |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
252 Note: row and col are always interpreted as |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
253 screen cells for the console application. |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
254 But, they may be interpreted as pixels |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
255 for the GUI, depending on "cell". |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
256 multiclick: set to 1 to inject a double-click mouse event. |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
257 modifiers: key modifiers. The supported values are: |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
258 4 shift is pressed |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
259 8 alt is pressed |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
260 16 ctrl is pressed |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
261 move: Optional; if used and TRUE then a mouse move |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
262 event can be generated. |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
263 Only {args} row: and col: are used and |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
264 required. |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
265 Only results in an event when 'mousemoveevent' |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
266 is set or a popup uses mouse move events. |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
267 cell: Optional for the GUI: when present and TRUE |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
268 then "move" uses screen cells instead of pixel |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
269 positions. Not used by the console. |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
270 |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
271 "key": |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
272 Send a low-level keyboard event (e.g. keyup or keydown). |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
273 The supported items in {args} are: |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
274 event: The supported string values are: |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
275 keyup generate a keyup event |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
276 keydown generate a keydown event |
31559
a3dca61f3ba3
patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents:
31503
diff
changeset
|
277 keycode: Keycode to use for a keyup or a keydown event. |
31503
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
278 modifiers: Optional; key modifiers. |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
279 The supported values are: |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
280 2 shift is pressed |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
281 4 ctrl is pressed |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
282 8 alt is pressed |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
283 Note: These values are different from the |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
284 mouse modifiers. |
31559
a3dca61f3ba3
patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents:
31503
diff
changeset
|
285 execute: Optional. Similar to |feedkeys()| mode x. |
a3dca61f3ba3
patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents:
31503
diff
changeset
|
286 When this is included and set to true |
a3dca61f3ba3
patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents:
31503
diff
changeset
|
287 (non-zero) then Vim will process any buffered |
a3dca61f3ba3
patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents:
31503
diff
changeset
|
288 unprocessed key events. All other {args} |
a3dca61f3ba3
patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents:
31503
diff
changeset
|
289 items are optional when this is set and true. |
a3dca61f3ba3
patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents:
31503
diff
changeset
|
290 |
a3dca61f3ba3
patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents:
31503
diff
changeset
|
291 Returns TRUE if the event is successfully added or executed, |
a3dca61f3ba3
patch 9.0.1112: test_mswin_event() can hang
Bram Moolenaar <Bram@vim.org>
parents:
31503
diff
changeset
|
292 FALSE if there is a failure. |
31503
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
293 |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
294 Can also be used as a |method|: > |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
295 GetEvent()->test_mswin_event({args}) |
b9a4699d6a35
patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Bram Moolenaar <Bram@vim.org>
parents:
31383
diff
changeset
|
296 < |
25700 | 297 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
298 test_null_blob() *test_null_blob()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
299 Return a |Blob| that is null. Only useful for testing. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
300 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
301 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
302 test_null_channel() *test_null_channel()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
303 Return a |Channel| that is null. Only useful for testing. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
304 {only available when compiled with the +channel feature} |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
305 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
306 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
307 test_null_dict() *test_null_dict()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
308 Return a |Dict| that is null. Only useful for testing. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
309 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
310 |
19874
f92435f0f449
patch 8.2.0493: Vim9: some error messages not tested
Bram Moolenaar <Bram@vim.org>
parents:
19523
diff
changeset
|
311 test_null_function() *test_null_function()* |
19968 | 312 Return a |Funcref| that is null. Only useful for testing. |
19874
f92435f0f449
patch 8.2.0493: Vim9: some error messages not tested
Bram Moolenaar <Bram@vim.org>
parents:
19523
diff
changeset
|
313 |
f92435f0f449
patch 8.2.0493: Vim9: some error messages not tested
Bram Moolenaar <Bram@vim.org>
parents:
19523
diff
changeset
|
314 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
315 test_null_job() *test_null_job()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
316 Return a |Job| that is null. Only useful for testing. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
317 {only available when compiled with the +job feature} |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
318 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
319 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
320 test_null_list() *test_null_list()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
321 Return a |List| that is null. Only useful for testing. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
322 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
323 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
324 test_null_partial() *test_null_partial()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
325 Return a |Partial| that is null. Only useful for testing. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
326 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
327 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
328 test_null_string() *test_null_string()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
329 Return a |String| that is null. Only useful for testing. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
330 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
331 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
332 test_option_not_set({name}) *test_option_not_set()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
333 Reset the flag that indicates option {name} was set. Thus it |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
334 looks like it still has the default value. Use like this: > |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
335 set ambiwidth=double |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
336 call test_option_not_set('ambiwidth') |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
337 < Now the 'ambiwidth' option behaves like it was never changed, |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
338 even though the value is "double". |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
339 Only to be used for testing! |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
340 |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
341 Can also be used as a |method|: > |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
342 GetOptionName()->test_option_not_set() |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
343 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
344 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
345 test_override({name}, {val}) *test_override()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
346 Overrides certain parts of Vim's internal processing to be able |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
347 to run tests. Only to be used for testing Vim! |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
348 The override is enabled when {val} is non-zero and removed |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
349 when {val} is zero. |
27116
5b267700e6ab
patch 8.2.4087: cannot test items from an autoload script easily
Bram Moolenaar <Bram@vim.org>
parents:
26591
diff
changeset
|
350 Current supported values for {name} are: |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
351 |
27116
5b267700e6ab
patch 8.2.4087: cannot test items from an autoload script easily
Bram Moolenaar <Bram@vim.org>
parents:
26591
diff
changeset
|
352 {name} effect when {val} is non-zero ~ |
29340
fba9e366ced4
patch 9.0.0013: reproducing memory access errors can be difficult
Bram Moolenaar <Bram@vim.org>
parents:
29314
diff
changeset
|
353 alloc_lines make a copy of every buffer line into allocated |
fba9e366ced4
patch 9.0.0013: reproducing memory access errors can be difficult
Bram Moolenaar <Bram@vim.org>
parents:
29314
diff
changeset
|
354 memory, so that memory access errors can be found |
fba9e366ced4
patch 9.0.0013: reproducing memory access errors can be difficult
Bram Moolenaar <Bram@vim.org>
parents:
29314
diff
changeset
|
355 by valgrind |
27116
5b267700e6ab
patch 8.2.4087: cannot test items from an autoload script easily
Bram Moolenaar <Bram@vim.org>
parents:
26591
diff
changeset
|
356 autoload `import autoload` will load the script right |
5b267700e6ab
patch 8.2.4087: cannot test items from an autoload script easily
Bram Moolenaar <Bram@vim.org>
parents:
26591
diff
changeset
|
357 away, not postponed until an item is used |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
358 char_avail disable the char_avail() function |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
359 nfa_fail makes the NFA regexp engine fail to force a |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
360 fallback to the old engine |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
361 no_query_mouse do not query the mouse position for "dec" |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
362 terminals |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
363 no_wait_return set the "no_wait_return" flag. Not restored |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
364 with "ALL". |
27116
5b267700e6ab
patch 8.2.4087: cannot test items from an autoload script easily
Bram Moolenaar <Bram@vim.org>
parents:
26591
diff
changeset
|
365 redraw disable the redrawing() function |
5b267700e6ab
patch 8.2.4087: cannot test items from an autoload script easily
Bram Moolenaar <Bram@vim.org>
parents:
26591
diff
changeset
|
366 redraw_flag ignore the RedrawingDisabled flag |
5b267700e6ab
patch 8.2.4087: cannot test items from an autoload script easily
Bram Moolenaar <Bram@vim.org>
parents:
26591
diff
changeset
|
367 starting reset the "starting" variable, see below |
5b267700e6ab
patch 8.2.4087: cannot test items from an autoload script easily
Bram Moolenaar <Bram@vim.org>
parents:
26591
diff
changeset
|
368 term_props reset all terminal properties when the version |
5b267700e6ab
patch 8.2.4087: cannot test items from an autoload script easily
Bram Moolenaar <Bram@vim.org>
parents:
26591
diff
changeset
|
369 string is detected |
20861
1725bb56178a
patch 8.2.0982: insufficient testing for reading/writing files
Bram Moolenaar <Bram@vim.org>
parents:
20856
diff
changeset
|
370 ui_delay time in msec to use in ui_delay(); overrules a |
1725bb56178a
patch 8.2.0982: insufficient testing for reading/writing files
Bram Moolenaar <Bram@vim.org>
parents:
20856
diff
changeset
|
371 wait time of up to 3 seconds for messages |
32004 | 372 uptime overrules sysinfo.uptime |
27257
68c33419fdc6
patch 8.2.4157: terminal test fails because Windows sets the title
Bram Moolenaar <Bram@vim.org>
parents:
27162
diff
changeset
|
373 vterm_title setting the window title by a job running in a |
68c33419fdc6
patch 8.2.4157: terminal test fails because Windows sets the title
Bram Moolenaar <Bram@vim.org>
parents:
27162
diff
changeset
|
374 terminal window |
29340
fba9e366ced4
patch 9.0.0013: reproducing memory access errors can be difficult
Bram Moolenaar <Bram@vim.org>
parents:
29314
diff
changeset
|
375 ALL clear all overrides, except alloc_lines ({val} is |
fba9e366ced4
patch 9.0.0013: reproducing memory access errors can be difficult
Bram Moolenaar <Bram@vim.org>
parents:
29314
diff
changeset
|
376 not used) |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
377 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
378 "starting" is to be used when a test should behave like |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
379 startup was done. Since the tests are run by sourcing a |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
380 script the "starting" variable is non-zero. This is usually a |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
381 good thing (tests run faster), but sometimes changes behavior |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
382 in a way that the test doesn't work properly. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
383 When using: > |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
384 call test_override('starting', 1) |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
385 < The value of "starting" is saved. It is restored by: > |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
386 call test_override('starting', 0) |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
387 |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
388 < Can also be used as a |method|: > |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
389 GetOverrideVal()-> test_override('starting') |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
390 |
25700 | 391 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
392 test_refcount({expr}) *test_refcount()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
393 Return the reference count of {expr}. When {expr} is of a |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
394 type that does not have a reference count, returns -1. Only |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
395 to be used for testing. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
396 |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
397 Can also be used as a |method|: > |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
398 GetVarname()->test_refcount() |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
399 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
400 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
401 test_setmouse({row}, {col}) *test_setmouse()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
402 Set the mouse position to be used for the next mouse action. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
403 {row} and {col} are one based. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
404 For example: > |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
405 call test_setmouse(4, 20) |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
406 call feedkeys("\<LeftMouse>", "xt") |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
407 |
25700 | 408 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
409 test_settime({expr}) *test_settime()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
410 Set the time Vim uses internally. Currently only used for |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
411 timestamps in the history, as they are used in viminfo, and |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
412 for undo. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
413 Using a value of 1 makes Vim not sleep after a warning or |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
414 error message. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
415 {expr} must evaluate to a number. When the value is zero the |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
416 normal behavior is restored. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
417 |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
418 Can also be used as a |method|: > |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
419 GetTime()->test_settime() |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17909
diff
changeset
|
420 |
25700 | 421 |
19350
76cb39bf1871
patch 8.2.0233: crash when using garbagecollect() in between rand()
Bram Moolenaar <Bram@vim.org>
parents:
19308
diff
changeset
|
422 test_srand_seed([seed]) *test_srand_seed()* |
76cb39bf1871
patch 8.2.0233: crash when using garbagecollect() in between rand()
Bram Moolenaar <Bram@vim.org>
parents:
19308
diff
changeset
|
423 When [seed] is given this sets the seed value used by |
76cb39bf1871
patch 8.2.0233: crash when using garbagecollect() in between rand()
Bram Moolenaar <Bram@vim.org>
parents:
19308
diff
changeset
|
424 `srand()`. When omitted the test seed is removed. |
76cb39bf1871
patch 8.2.0233: crash when using garbagecollect() in between rand()
Bram Moolenaar <Bram@vim.org>
parents:
19308
diff
changeset
|
425 |
25700 | 426 |
427 test_unknown() *test_unknown()* | |
428 Return a value with unknown type. Only useful for testing. | |
429 | |
430 | |
431 test_void() *test_void()* | |
432 Return a value with void type. Only useful for testing. | |
433 | |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
434 ============================================================================== |
17571 | 435 3. Assert functions *assert-functions-details* |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
436 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
437 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
438 assert_beeps({cmd}) *assert_beeps()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
439 Run {cmd} and add an error message to |v:errors| if it does |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
440 NOT produce a beep or visual bell. |
24307
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24103
diff
changeset
|
441 Also see |assert_fails()|, |assert_nobeep()| and |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24103
diff
changeset
|
442 |assert-return|. |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
443 |
17728
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
444 Can also be used as a |method|: > |
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
445 GetCmd()->assert_beeps() |
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
446 < |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
447 *assert_equal()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
448 assert_equal({expected}, {actual} [, {msg}]) |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
449 When {expected} and {actual} are not equal an error message is |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
450 added to |v:errors| and 1 is returned. Otherwise zero is |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
451 returned |assert-return|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
452 There is no automatic conversion, the String "4" is different |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
453 from the Number 4. And the number 4 is different from the |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
454 Float 4.0. The value of 'ignorecase' is not used here, case |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
455 always matters. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
456 When {msg} is omitted an error in the form "Expected |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
457 {expected} but got {actual}" is produced. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
458 Example: > |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
459 assert_equal('foo', 'bar') |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
460 < Will result in a string to be added to |v:errors|: |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
461 test.vim line 12: Expected 'foo' but got 'bar' ~ |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
462 |
21250 | 463 Can also be used as a |method|, the base is passed as the |
464 second argument: > | |
17620
072efa9ca875
patch 8.1.1807: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17571
diff
changeset
|
465 mylist->assert_equal([1, 2, 3]) |
072efa9ca875
patch 8.1.1807: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17571
diff
changeset
|
466 |
072efa9ca875
patch 8.1.1807: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17571
diff
changeset
|
467 < *assert_equalfile()* |
20679
1af1d8ff2aa8
patch 8.2.0893: assert_equalfile() does not take a third argument
Bram Moolenaar <Bram@vim.org>
parents:
19968
diff
changeset
|
468 assert_equalfile({fname-one}, {fname-two} [, {msg}]) |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
469 When the files {fname-one} and {fname-two} do not contain |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
470 exactly the same text an error message is added to |v:errors|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
471 Also see |assert-return|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
472 When {fname-one} or {fname-two} does not exist the error will |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
473 mention that. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
474 Mainly useful with |terminal-diff|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
475 |
17825
ce993ba17adb
patch 8.1.1909: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17758
diff
changeset
|
476 Can also be used as a |method|: > |
ce993ba17adb
patch 8.1.1909: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17758
diff
changeset
|
477 GetLog()->assert_equalfile('expected.log') |
ce993ba17adb
patch 8.1.1909: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17758
diff
changeset
|
478 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
479 assert_exception({error} [, {msg}]) *assert_exception()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
480 When v:exception does not contain the string {error} an error |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
481 message is added to |v:errors|. Also see |assert-return|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
482 This can be used to assert that a command throws an exception. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
483 Using the error number, followed by a colon, avoids problems |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
484 with translations: > |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
485 try |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
486 commandthatfails |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
487 call assert_false(1, 'command should have failed') |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
488 catch |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
489 call assert_exception('E492:') |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
490 endtry |
21859
3e5d0832a2e7
patch 8.2.1479: Vim9: error for list index uses wrong line number
Bram Moolenaar <Bram@vim.org>
parents:
21779
diff
changeset
|
491 < |
3e5d0832a2e7
patch 8.2.1479: Vim9: error for list index uses wrong line number
Bram Moolenaar <Bram@vim.org>
parents:
21779
diff
changeset
|
492 *assert_fails()* |
22163
b6d36f0b4f03
patch 8.2.1631: test_fails() does not check the context of the line number
Bram Moolenaar <Bram@vim.org>
parents:
21991
diff
changeset
|
493 assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]]) |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
494 Run {cmd} and add an error message to |v:errors| if it does |
21265
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
495 NOT produce an error or when {error} is not found in the |
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
496 error message. Also see |assert-return|. |
27321 | 497 *E856* |
21265
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
498 When {error} is a string it must be found literally in the |
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
499 first reported error. Most often this will be the error code, |
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
500 including the colon, e.g. "E123:". > |
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
501 assert_fails('bad cmd', 'E987:') |
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
502 < |
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
503 When {error} is a |List| with one or two strings, these are |
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
504 used as patterns. The first pattern is matched against the |
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
505 first reported error: > |
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
506 assert_fails('cmd', ['E987:.*expected bool']) |
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
507 < The second pattern, if present, is matched against the last |
23305 | 508 reported error. |
509 If there is only one error then both patterns must match. This | |
510 can be used to check that there is only one error. | |
511 To only match the last error use an empty string for the first | |
512 error: > | |
21265
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
513 assert_fails('cmd', ['', 'E987:']) |
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21250
diff
changeset
|
514 < |
21859
3e5d0832a2e7
patch 8.2.1479: Vim9: error for list index uses wrong line number
Bram Moolenaar <Bram@vim.org>
parents:
21779
diff
changeset
|
515 If {msg} is empty then it is not used. Do this to get the |
3e5d0832a2e7
patch 8.2.1479: Vim9: error for list index uses wrong line number
Bram Moolenaar <Bram@vim.org>
parents:
21779
diff
changeset
|
516 default message when passing the {lnum} argument. |
27459 | 517 *E1115* |
21859
3e5d0832a2e7
patch 8.2.1479: Vim9: error for list index uses wrong line number
Bram Moolenaar <Bram@vim.org>
parents:
21779
diff
changeset
|
518 When {lnum} is present and not negative, and the {error} |
3e5d0832a2e7
patch 8.2.1479: Vim9: error for list index uses wrong line number
Bram Moolenaar <Bram@vim.org>
parents:
21779
diff
changeset
|
519 argument is present and matches, then this is compared with |
3e5d0832a2e7
patch 8.2.1479: Vim9: error for list index uses wrong line number
Bram Moolenaar <Bram@vim.org>
parents:
21779
diff
changeset
|
520 the line number at which the error was reported. That can be |
3e5d0832a2e7
patch 8.2.1479: Vim9: error for list index uses wrong line number
Bram Moolenaar <Bram@vim.org>
parents:
21779
diff
changeset
|
521 the line number in a function or in a script. |
27459 | 522 *E1116* |
22163
b6d36f0b4f03
patch 8.2.1631: test_fails() does not check the context of the line number
Bram Moolenaar <Bram@vim.org>
parents:
21991
diff
changeset
|
523 When {context} is present it is used as a pattern and matched |
b6d36f0b4f03
patch 8.2.1631: test_fails() does not check the context of the line number
Bram Moolenaar <Bram@vim.org>
parents:
21991
diff
changeset
|
524 against the context (script name or function name) where |
b6d36f0b4f03
patch 8.2.1631: test_fails() does not check the context of the line number
Bram Moolenaar <Bram@vim.org>
parents:
21991
diff
changeset
|
525 {lnum} is located in. |
b6d36f0b4f03
patch 8.2.1631: test_fails() does not check the context of the line number
Bram Moolenaar <Bram@vim.org>
parents:
21991
diff
changeset
|
526 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
527 Note that beeping is not considered an error, and some failing |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
528 commands only beep. Use |assert_beeps()| for those. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
529 |
17728
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
530 Can also be used as a |method|: > |
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
531 GetCmd()->assert_fails('E99:') |
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
532 |
21859
3e5d0832a2e7
patch 8.2.1479: Vim9: error for list index uses wrong line number
Bram Moolenaar <Bram@vim.org>
parents:
21779
diff
changeset
|
533 assert_false({actual} [, {msg}]) *assert_false()* |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
534 When {actual} is not false an error message is added to |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
535 |v:errors|, like with |assert_equal()|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
536 Also see |assert-return|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
537 A value is false when it is zero. When {actual} is not a |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
538 number the assert fails. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
539 When {msg} is omitted an error in the form |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
540 "Expected False but got {actual}" is produced. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
541 |
17728
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
542 Can also be used as a |method|: > |
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
543 GetResult()->assert_false() |
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
544 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
545 assert_inrange({lower}, {upper}, {actual} [, {msg}]) *assert_inrange()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
546 This asserts number and |Float| values. When {actual} is lower |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
547 than {lower} or higher than {upper} an error message is added |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
548 to |v:errors|. Also see |assert-return|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
549 When {msg} is omitted an error in the form |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
550 "Expected range {lower} - {upper}, but got {actual}" is |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
551 produced. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
552 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
553 *assert_match()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
554 assert_match({pattern}, {actual} [, {msg}]) |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
555 When {pattern} does not match {actual} an error message is |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
556 added to |v:errors|. Also see |assert-return|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
557 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
558 {pattern} is used as with |=~|: The matching is always done |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
559 like 'magic' was set and 'cpoptions' is empty, no matter what |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
560 the actual value of 'magic' or 'cpoptions' is. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
561 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
562 {actual} is used as a string, automatic conversion applies. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
563 Use "^" and "$" to match with the start and end of the text. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
564 Use both to match the whole text. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
565 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
566 When {msg} is omitted an error in the form |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
567 "Pattern {pattern} does not match {actual}" is produced. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
568 Example: > |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
569 assert_match('^f.*o$', 'foobar') |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
570 < Will result in a string to be added to |v:errors|: |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
571 test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~ |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
572 |
17728
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
573 Can also be used as a |method|: > |
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
574 getFile()->assert_match('foo.*') |
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
575 < |
24307
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24103
diff
changeset
|
576 assert_nobeep({cmd}) *assert_nobeep()* |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24103
diff
changeset
|
577 Run {cmd} and add an error message to |v:errors| if it |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24103
diff
changeset
|
578 produces a beep or visual bell. |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24103
diff
changeset
|
579 Also see |assert_beeps()|. |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24103
diff
changeset
|
580 |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24103
diff
changeset
|
581 Can also be used as a |method|: > |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24103
diff
changeset
|
582 GetCmd()->assert_nobeep() |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24103
diff
changeset
|
583 < |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
584 *assert_notequal()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
585 assert_notequal({expected}, {actual} [, {msg}]) |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
586 The opposite of `assert_equal()`: add an error message to |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
587 |v:errors| when {expected} and {actual} are equal. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
588 Also see |assert-return|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
589 |
17620
072efa9ca875
patch 8.1.1807: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17571
diff
changeset
|
590 Can also be used as a |method|: > |
072efa9ca875
patch 8.1.1807: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17571
diff
changeset
|
591 mylist->assert_notequal([1, 2, 3]) |
072efa9ca875
patch 8.1.1807: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17571
diff
changeset
|
592 |
072efa9ca875
patch 8.1.1807: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17571
diff
changeset
|
593 < *assert_notmatch()* |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
594 assert_notmatch({pattern}, {actual} [, {msg}]) |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
595 The opposite of `assert_match()`: add an error message to |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
596 |v:errors| when {pattern} matches {actual}. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
597 Also see |assert-return|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
598 |
17728
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
599 Can also be used as a |method|: > |
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
600 getFile()->assert_notmatch('bar.*') |
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
601 |
17825
ce993ba17adb
patch 8.1.1909: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17758
diff
changeset
|
602 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
603 assert_report({msg}) *assert_report()* |
25619 | 604 Report a test failure directly, using String {msg}. |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
605 Always returns one. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
606 |
17825
ce993ba17adb
patch 8.1.1909: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17758
diff
changeset
|
607 Can also be used as a |method|: > |
ce993ba17adb
patch 8.1.1909: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17758
diff
changeset
|
608 GetMessage()->assert_report() |
ce993ba17adb
patch 8.1.1909: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17758
diff
changeset
|
609 |
ce993ba17adb
patch 8.1.1909: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17758
diff
changeset
|
610 |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
611 assert_true({actual} [, {msg}]) *assert_true()* |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
612 When {actual} is not true an error message is added to |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
613 |v:errors|, like with |assert_equal()|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
614 Also see |assert-return|. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
615 A value is TRUE when it is a non-zero number. When {actual} |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
616 is not a number the assert fails. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
617 When {msg} is omitted an error in the form "Expected True but |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
618 got {actual}" is produced. |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
619 |
17728
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
620 Can also be used as a |method|: > |
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
621 GetResult()->assert_true() |
68ea27d26d5b
patch 8.1.1861: only some assert functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17620
diff
changeset
|
622 < |
17456
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
623 |
e414281d8bb4
patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
624 vim:tw=78:ts=8:noet:ft=help:norl: |