annotate src/testdir/test_cmd_lists.vim @ 33988:7c30841c60a0 v9.0.2180

patch 9.0.2180: POSIX function name in exarg causes issues Commit: https://github.com/vim/vim/commit/6fdb6280821a822768df5689a5d727e37d38306c Author: Zoltan Arpadffy <zoltan.arpadffy@gmail.com> Date: Tue Dec 19 20:53:07 2023 +0100 patch 9.0.2180: POSIX function name in exarg causes issues Problem: POSIX function name in exarg struct causes issues on OpenVMS Solution: Rename getline member in exarg struct to ea_getline, remove isinf() workaround for VMS There are compilers that do not treat well POSIX functions - like getline - usage in the structs. Older VMS compilers could digest this... but the newer OpenVMS compilers ( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these structs. This could be limited to getline() that is defined via getdelim() and might not affect all POSIX functions in general - but avoiding POSIX function names usage in the structs is a "safe side" practice without compromising the functionality or the code readability. The previous OpenVMS X86 port used a workaround limiting the compiler capabilities using __CRTL_VER_OVERRIDE=80400000 In order to make the OpenVMS port future proof, this pull request proposes a possible solution. closes: #13704 Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 19 Dec 2023 21:00:04 +0100
parents dbec60b8c253
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30837
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Test to verify that the cmd list in runtime/doc/index.txt contains all of
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " the commands in src/ex_cmds.h. It doesn't map the other way round because
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " index.txt contains some shorthands like :!! which are useful to list, but
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " they don't exist as an independent entry in src/ex_cmds.h.
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 "
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 " Currently this just checks for existence, and we aren't checking for whether
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 " they are sorted in the index, or whether the substring needed (e.g.
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 " 'defc[ompile]') is correct or not.
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 func Test_cmd_lists()
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 " Create a list of the commands in ex_cmds.h:CMD_index.
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 enew!
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 read ../ex_cmds.h
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 1,/^enum CMD_index$/d
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 call search('^};$')
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 .,$d
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 v/^EXCMD/d
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 %s/^.*"\(\S\+\)".*$/\1/
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 " Special case ':*' because it's represented as ':star'
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 %s/^\*$/star/
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 sort u
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 let l:command_list = getline(1, '$')
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 " Verify that the ':help ex-cmd-index' list contains all known commands.
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 enew!
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 if filereadable('../../doc/index.txt')
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 " unpacked MS-Windows zip archive
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 read ../../doc/index.txt
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 else
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 read ../../runtime/doc/index.txt
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 endif
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 call search('\*ex-cmd-index\*')
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 1,.d
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 v/^|:/d
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 %s/^|:\(\S*\)|.*/\1/
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 sort u
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 norm gg
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 let l:missing_cmds = []
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 for cmd in l:command_list
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 " Reserved Vim 9 commands or other script-only syntax aren't useful to
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 " document as Ex commands.
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 let l:vim9cmds = [
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 \ 'abstract',
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 \ 'class',
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 \ 'endclass',
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 \ 'endenum',
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 \ 'endinterface',
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 \ 'enum',
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 \ 'interface',
31337
2ddb98b138b5 patch 9.0.1002: command list test fails
Bram Moolenaar <Bram@vim.org>
parents: 30837
diff changeset
51 \ 'public',
30837
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 \ 'static',
31849
dbec60b8c253 patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents: 31337
diff changeset
53 \ 'this',
30837
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 \ 'type',
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 \ '++',
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 \ '--',
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 \ '{',
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 \ '}']
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 if index(l:vim9cmds, cmd) != -1
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 continue
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 endif
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 if search('^\V' .. cmd .. '\v$', 'cW') == 0
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 call add(l:missing_cmds, ':' .. cmd)
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 endif
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 endfor
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 call assert_equal(0, len(l:missing_cmds), "Missing commands from `:help ex-cmd-index`: " .. string(l:missing_cmds))
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 endfunc
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69
82c3677f8af1 patch 9.0.0753: some Ex commands are not in the help index
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 " vim: shiftwidth=2 sts=2 expandtab