Mercurial > vim
annotate src/testdir/test_function_lists.vim @ 27285:53edd190a607 v8.2.4171
patch 8.2.4171: cannot invoke option function using autoload import
Commit: https://github.com/vim/vim/commit/f0e7e6365e86ca42c177fe165d3097d1bfb35f72
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 21 13:29:56 2022 +0000
patch 8.2.4171: cannot invoke option function using autoload import
Problem: Cannot invoke option function using autoload import.
Solution: Expand the import to an autoload function name. (closes https://github.com/vim/vim/issues/9578)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 21 Jan 2022 14:45:03 +0100 |
parents | b24b2217ff9e |
children | a7a9e8b9af89 |
rev | line source |
---|---|
20689
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " Test to verify that the three function lists, |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 " |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 " global_functions[] in src/evalfunc.c |
26780
b24b2217ff9e
patch 8.2.3918: function list test fails
Bram Moolenaar <Bram@vim.org>
parents:
24840
diff
changeset
|
4 " *functions* in runtime/doc/builtin.txt |
20689
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 " *function-list* in runtime/doc/usr_41.txt |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 " |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 " contain the same functions and that the global_functions and ":help |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 " functions" lists are in ASCII order. |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 func Test_function_lists() |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 " Delete any files left over from an earlier run of this test. |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 call delete("Xglobal_functions.diff") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 call delete("Xfunctions.diff") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 call delete("Xfunction-list.diff") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 " Create a file of the functions in evalfunc.c:global_functions[]. |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 enew! |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 read ../evalfunc.c |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 1,/^static funcentry_T global_functions\[\] =$/d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 call search('^};$') |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
24 .,$d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
25 v/^ {/d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
26 %s/^ {"// |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
27 %s/".*// |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
28 w! Xglobal_functions |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
29 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
30 " Verify that those functions are in ASCII order. |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
31 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
32 sort u |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
33 w! Xsorted_global_functions |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 let l:unequal = assert_equalfile("Xsorted_global_functions", "Xglobal_functions", |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 \ "global_functions[] not sorted") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 if l:unequal && executable("diff") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 call system("diff -u Xsorted_global_functions Xglobal_functions > Xglobal_functions.diff") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 endif |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 " Create a file of the functions in evalfunc.c:global_functions[] that are |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
41 " not obsolete, sorted in ASCII order. |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
42 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
43 enew! |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
44 read ../evalfunc.c |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
45 1,/^static funcentry_T global_functions\[\] =$/d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
46 call search('^};$') |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
47 .,$d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
48 v/^ {/d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
49 g/\/\/ obsolete$/d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
50 %s/^ {"// |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
51 %s/".*// |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
52 sort u |
20693
f342bdc79295
patch 8.2.0900: function list test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
20689
diff
changeset
|
53 w! ++ff=unix Xsorted_current_global_functions |
20689
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
54 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
55 " Verify that the ":help functions" list is complete and in ASCII order. |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
56 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
57 enew! |
26780
b24b2217ff9e
patch 8.2.3918: function list test fails
Bram Moolenaar <Bram@vim.org>
parents:
24840
diff
changeset
|
58 if filereadable('../../doc/builtin.txt') |
24570
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
59 " unpacked MS-Windows zip archive |
26780
b24b2217ff9e
patch 8.2.3918: function list test fails
Bram Moolenaar <Bram@vim.org>
parents:
24840
diff
changeset
|
60 read ../../doc/builtin.txt |
24570
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
61 else |
26780
b24b2217ff9e
patch 8.2.3918: function list test fails
Bram Moolenaar <Bram@vim.org>
parents:
24840
diff
changeset
|
62 read ../../runtime/doc/builtin.txt |
24570
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
63 endif |
20689
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
64 call search('^USAGE') |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
65 1,.d |
26780
b24b2217ff9e
patch 8.2.3918: function list test fails
Bram Moolenaar <Bram@vim.org>
parents:
24840
diff
changeset
|
66 call search('^==========') |
20689
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
67 .,$d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
68 v/^\S/d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
69 %s/(.*// |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
70 let l:lines = getline(1, '$') |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
71 call uniq(l:lines) |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
72 call writefile(l:lines, "Xfunctions") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
73 let l:unequal = assert_equalfile("Xsorted_current_global_functions", "Xfunctions", |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
74 \ "\":help functions\" not sorted or incomplete") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
75 if l:unequal && executable("diff") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
76 call system("diff -u Xsorted_current_global_functions Xfunctions > Xfunctions.diff") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
77 endif |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
78 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
79 " Verify that the ":help function-list" list is complete. |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
80 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
81 enew! |
24570
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
82 if filereadable('../../doc/usr_41.txt') |
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
83 " unpacked MS-Windows zip archive |
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
84 read ../../doc/usr_41.txt |
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
85 else |
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
86 read ../../runtime/doc/usr_41.txt |
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
87 endif |
20689
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
88 call search('\*function-list\*$') |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
89 1,.d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
90 call search('^==*$') |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
91 .,$d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
92 v/^\t\S/d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
93 %s/(.*// |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
94 %left |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
95 sort u |
20693
f342bdc79295
patch 8.2.0900: function list test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
20689
diff
changeset
|
96 w! ++ff=unix Xfunction-list |
20689
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
97 let l:unequal = assert_equalfile("Xsorted_current_global_functions", "Xfunction-list", |
24840
c7aa7acb23bb
patch 8.2.2958: function list test fails
Bram Moolenaar <Bram@vim.org>
parents:
24570
diff
changeset
|
98 \ "\":help function-list\" incomplete") |
20689
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
99 if l:unequal && executable("diff") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
100 call system("diff -u Xsorted_current_global_functions Xfunction-list > Xfunction-list.diff") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
101 endif |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
102 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
103 " Clean up. |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
104 call delete("Xglobal_functions") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
105 call delete("Xsorted_global_functions") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
106 call delete("Xsorted_current_global_functions") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
107 call delete("Xfunctions") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
108 call delete("Xfunction-list") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
109 enew! |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
110 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
111 endfunc |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
112 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
113 " vim: shiftwidth=2 sts=2 expandtab |