Mercurial > vim
annotate src/testdir/test_function_lists.vim @ 26296:9f32ccdadd22 v8.2.3679
patch 8.2.3679: objc file detected as Octave
Commit: https://github.com/vim/vim/commit/7329cfab36356c48edab7ed68f6244eb9e20a5b1
Author: Doug Kearns <dougkearns@gmail.com>
Date: Fri Nov 26 13:01:41 2021 +0000
patch 8.2.3679: objc file detected as Octave
Problem: objc file detected as Octave. (Antony Lee)
Solution: Detect objc by preprocessor lines. (Doug Kearns, closes https://github.com/vim/vim/issues/9223,
closes #9220)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 26 Nov 2021 14:15:05 +0100 |
parents | c7aa7acb23bb |
children | b24b2217ff9e |
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 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 " *functions* in runtime/doc/eval.txt |
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! |
24570
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
58 if filereadable('../../doc/eval.txt') |
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 |
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
60 read ../../doc/eval.txt |
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
61 else |
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
62 read ../../runtime/doc/eval.txt |
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('\*functions\*$') |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
65 call search('^USAGE') |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
66 1,.d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
67 call search('\*\K\k*()\*$') |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
68 .,$d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
69 v/^\S/d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
70 %s/(.*// |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
71 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
|
72 call uniq(l:lines) |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
73 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
|
74 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
|
75 \ "\":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
|
76 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
|
77 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
|
78 endif |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
79 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
80 " 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
|
81 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
82 enew! |
24570
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
83 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
|
84 " 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
|
85 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
|
86 else |
27033b8bba0e
patch 8.2.2824: MS-Windows: build failure with MSVC
Bram Moolenaar <Bram@vim.org>
parents:
20693
diff
changeset
|
87 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
|
88 endif |
20689
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
89 call search('\*function-list\*$') |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
90 1,.d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
91 call search('^==*$') |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
92 .,$d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
93 v/^\t\S/d |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
94 %s/(.*// |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
95 %left |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
96 sort u |
20693
f342bdc79295
patch 8.2.0900: function list test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
20689
diff
changeset
|
97 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
|
98 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
|
99 \ "\":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
|
100 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
|
101 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
|
102 endif |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
103 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
104 " Clean up. |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
105 call delete("Xglobal_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_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("Xsorted_current_global_functions") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
108 call delete("Xfunctions") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
109 call delete("Xfunction-list") |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
110 enew! |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
111 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
112 endfunc |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
113 |
b005de48b374
patch 8.2.0898: missing help for a function goes unnoticed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
114 " vim: shiftwidth=2 sts=2 expandtab |