annotate src/testdir/check.vim @ 19746:1da2fb80b512 v8.2.0429

patch 8.2.0429: no warning when test checks for option that never exists Commit: https://github.com/vim/vim/commit/c5a8fdc42dbd304598b2d73db754c7b97665b182 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 22 20:13:39 2020 +0100 patch 8.2.0429: no warning when test checks for option that never exists Problem: No warning when test checks for option that never exists. Solution: In tests check that the option can exist.
author Bram Moolenaar <Bram@vim.org>
date Sun, 22 Mar 2020 20:15:04 +0100
parents 810eee1b42e3
children 2dc5e6ddeb4c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18277
f6dcf7eabd26 patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents: 17668
diff changeset
1 source shared.vim
19273
a4b65930a0dc patch 8.2.0195: some tests fail when run in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 19259
diff changeset
2 source term_util.vim
18277
f6dcf7eabd26 patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents: 17668
diff changeset
3
19259
77cce0439714 patch 8.2.0188: Check commands don't work well with Vim9 script
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
4 command -nargs=1 MissingFeature throw 'Skipped: ' .. <args> .. ' feature missing'
77cce0439714 patch 8.2.0188: Check commands don't work well with Vim9 script
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
5
17089
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 " Command to check for the presence of a feature.
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 command -nargs=1 CheckFeature call CheckFeature(<f-args>)
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 func CheckFeature(name)
19742
810eee1b42e3 patch 8.2.0427: it is not possible to check for a typo in a feature name
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
9 if !has(a:name, 1)
810eee1b42e3 patch 8.2.0427: it is not possible to check for a typo in a feature name
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
10 throw 'Checking for non-existent feature ' .. a:name
810eee1b42e3 patch 8.2.0427: it is not possible to check for a typo in a feature name
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
11 endif
17089
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 if !has(a:name)
19259
77cce0439714 patch 8.2.0188: Check commands don't work well with Vim9 script
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
13 MissingFeature a:name
17089
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 endif
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 endfunc
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 " Command to check for the presence of a working option.
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 command -nargs=1 CheckOption call CheckOption(<f-args>)
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 func CheckOption(name)
19746
1da2fb80b512 patch 8.2.0429: no warning when test checks for option that never exists
Bram Moolenaar <Bram@vim.org>
parents: 19742
diff changeset
20 if !exists('&' .. a:name)
1da2fb80b512 patch 8.2.0429: no warning when test checks for option that never exists
Bram Moolenaar <Bram@vim.org>
parents: 19742
diff changeset
21 throw 'Checking for non-existent option ' .. a:name
1da2fb80b512 patch 8.2.0429: no warning when test checks for option that never exists
Bram Moolenaar <Bram@vim.org>
parents: 19742
diff changeset
22 endif
17089
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 if !exists('+' .. a:name)
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 throw 'Skipped: ' .. a:name .. ' option not supported'
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 endif
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 endfunc
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 " Command to check for the presence of a function.
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 command -nargs=1 CheckFunction call CheckFunction(<f-args>)
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 func CheckFunction(name)
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 if !exists('*' .. a:name)
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 throw 'Skipped: ' .. a:name .. ' function missing'
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 endif
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 endfunc
17557
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
35
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
36 " Command to check for the presence of an Ex command
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
37 command -nargs=1 CheckCommand call CheckCommand(<f-args>)
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
38 func CheckCommand(name)
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
39 if !exists(':' .. a:name)
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
40 throw 'Skipped: ' .. a:name .. ' command not supported'
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
41 endif
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
42 endfunc
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
43
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
44 " Command to check for the presence of a shell command
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
45 command -nargs=1 CheckExecutable call CheckExecutable(<f-args>)
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
46 func CheckExecutable(name)
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
47 if !executable(a:name)
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
48 throw 'Skipped: ' .. a:name .. ' program not executable'
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
49 endif
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
50 endfunc
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
51
17557
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
52 " Command to check for running on MS-Windows
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
53 command CheckMSWindows call CheckMSWindows()
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
54 func CheckMSWindows()
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
55 if !has('win32')
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
56 throw 'Skipped: only works on MS-Windows'
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
57 endif
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
58 endfunc
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
59
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
60 " Command to check for NOT running on MS-Windows
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
61 command CheckNotMSWindows call CheckNotMSWindows()
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
62 func CheckNotMSWindows()
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
63 if has('win32')
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
64 throw 'Skipped: does not work on MS-Windows'
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
65 endif
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
66 endfunc
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
67
17557
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
68 " Command to check for running on Unix
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
69 command CheckUnix call CheckUnix()
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
70 func CheckUnix()
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
71 if !has('unix')
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
72 throw 'Skipped: only works on Unix'
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
73 endif
4a22102fda8f patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
74 endfunc
17614
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
75
18736
97d534e17874 patch 8.1.2358: tests fail on Cirrus CI for FreeBSD
Bram Moolenaar <Bram@vim.org>
parents: 18277
diff changeset
76 " Command to check for not running on a BSD system.
97d534e17874 patch 8.1.2358: tests fail on Cirrus CI for FreeBSD
Bram Moolenaar <Bram@vim.org>
parents: 18277
diff changeset
77 " TODO: using this checks should not be needed
97d534e17874 patch 8.1.2358: tests fail on Cirrus CI for FreeBSD
Bram Moolenaar <Bram@vim.org>
parents: 18277
diff changeset
78 command CheckNotBSD call CheckNotBSD()
97d534e17874 patch 8.1.2358: tests fail on Cirrus CI for FreeBSD
Bram Moolenaar <Bram@vim.org>
parents: 18277
diff changeset
79 func CheckNotBSD()
97d534e17874 patch 8.1.2358: tests fail on Cirrus CI for FreeBSD
Bram Moolenaar <Bram@vim.org>
parents: 18277
diff changeset
80 if has('bsd')
97d534e17874 patch 8.1.2358: tests fail on Cirrus CI for FreeBSD
Bram Moolenaar <Bram@vim.org>
parents: 18277
diff changeset
81 throw 'Skipped: does not work on BSD'
97d534e17874 patch 8.1.2358: tests fail on Cirrus CI for FreeBSD
Bram Moolenaar <Bram@vim.org>
parents: 18277
diff changeset
82 endif
97d534e17874 patch 8.1.2358: tests fail on Cirrus CI for FreeBSD
Bram Moolenaar <Bram@vim.org>
parents: 18277
diff changeset
83 endfunc
97d534e17874 patch 8.1.2358: tests fail on Cirrus CI for FreeBSD
Bram Moolenaar <Bram@vim.org>
parents: 18277
diff changeset
84
17614
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
85 " Command to check that making screendumps is supported.
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
86 " Caller must source screendump.vim
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
87 command CheckScreendump call CheckScreendump()
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
88 func CheckScreendump()
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
89 if !CanRunVimInTerminal()
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
90 throw 'Skipped: cannot make screendumps'
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
91 endif
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
92 endfunc
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
93
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
94 " Command to check that we can Run Vim in a terminal window
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
95 command CheckRunVimInTerminal call CheckRunVimInTerminal()
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
96 func CheckRunVimInTerminal()
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
97 if !CanRunVimInTerminal()
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
98 throw 'Skipped: cannot run Vim in a terminal window'
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
99 endif
d7708560b77c patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents: 17557
diff changeset
100 endfunc
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
101
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
102 " Command to check that we can run the GUI
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
103 command CheckCanRunGui call CheckCanRunGui()
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
104 func CheckCanRunGui()
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
105 if !has('gui') || ($DISPLAY == "" && !has('gui_running'))
17668
923154c51bef patch 8.1.1831: confusing skipped message
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
106 throw 'Skipped: cannot start the GUI'
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
107 endif
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
108 endfunc
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
109
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
110 " Command to check that we are using the GUI
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
111 command CheckGui call CheckGui()
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
112 func CheckGui()
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
113 if !has('gui_running')
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
114 throw 'Skipped: only works in the GUI'
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
115 endif
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
116 endfunc
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
117
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
118 " Command to check that not currently using the GUI
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
119 command CheckNotGui call CheckNotGui()
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
120 func CheckNotGui()
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
121 if has('gui_running')
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
122 throw 'Skipped: only works in the terminal'
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
123 endif
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17614
diff changeset
124 endfunc
18277
f6dcf7eabd26 patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents: 17668
diff changeset
125
f6dcf7eabd26 patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents: 17668
diff changeset
126 " Command to check that test is not running as root
f6dcf7eabd26 patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents: 17668
diff changeset
127 command CheckNotRoot call CheckNotRoot()
f6dcf7eabd26 patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents: 17668
diff changeset
128 func CheckNotRoot()
f6dcf7eabd26 patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents: 17668
diff changeset
129 if IsRoot()
f6dcf7eabd26 patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents: 17668
diff changeset
130 throw 'Skipped: cannot run test as root'
f6dcf7eabd26 patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents: 17668
diff changeset
131 endif
f6dcf7eabd26 patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents: 17668
diff changeset
132 endfunc