Mercurial > vim
annotate src/testdir/check.vim @ 33738:2172872dfbcd v9.0.2096
patch 9.0.2096: Vim9: confusing usage of private
Commit: https://github.com/vim/vim/commit/03042a2753e3e6ac971045a8ce256d709214710e
Author: Ernie Rael <errael@raelity.com>
Date: Sat Nov 11 08:53:32 2023 +0100
patch 9.0.2096: Vim9: confusing usage of private
Problem: Vim9: confusing usage of private
Solution: clarify and use protected keyword instead
[vim9class] document `_` as protected instead of private
fixes #13504
closes: #13520
Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 11 Nov 2023 09:00:06 +0100 |
parents | a1b4d1dae6b1 |
children | 995b539939c4 |
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 |
25112
c39a64bc5ca2
patch 8.2.3093: tablabel_tooltip test fails with Athena
Bram Moolenaar <Bram@vim.org>
parents:
24268
diff
changeset
|
17 " Command to check for the absence of a feature. |
c39a64bc5ca2
patch 8.2.3093: tablabel_tooltip test fails with Athena
Bram Moolenaar <Bram@vim.org>
parents:
24268
diff
changeset
|
18 command -nargs=1 CheckNotFeature call CheckNotFeature(<f-args>) |
c39a64bc5ca2
patch 8.2.3093: tablabel_tooltip test fails with Athena
Bram Moolenaar <Bram@vim.org>
parents:
24268
diff
changeset
|
19 func CheckNotFeature(name) |
c39a64bc5ca2
patch 8.2.3093: tablabel_tooltip test fails with Athena
Bram Moolenaar <Bram@vim.org>
parents:
24268
diff
changeset
|
20 if !has(a:name, 1) |
c39a64bc5ca2
patch 8.2.3093: tablabel_tooltip test fails with Athena
Bram Moolenaar <Bram@vim.org>
parents:
24268
diff
changeset
|
21 throw 'Checking for non-existent feature ' .. a:name |
c39a64bc5ca2
patch 8.2.3093: tablabel_tooltip test fails with Athena
Bram Moolenaar <Bram@vim.org>
parents:
24268
diff
changeset
|
22 endif |
c39a64bc5ca2
patch 8.2.3093: tablabel_tooltip test fails with Athena
Bram Moolenaar <Bram@vim.org>
parents:
24268
diff
changeset
|
23 if has(a:name) |
c39a64bc5ca2
patch 8.2.3093: tablabel_tooltip test fails with Athena
Bram Moolenaar <Bram@vim.org>
parents:
24268
diff
changeset
|
24 throw 'Skipped: ' .. a:name .. ' feature present' |
c39a64bc5ca2
patch 8.2.3093: tablabel_tooltip test fails with Athena
Bram Moolenaar <Bram@vim.org>
parents:
24268
diff
changeset
|
25 endif |
c39a64bc5ca2
patch 8.2.3093: tablabel_tooltip test fails with Athena
Bram Moolenaar <Bram@vim.org>
parents:
24268
diff
changeset
|
26 endfunc |
c39a64bc5ca2
patch 8.2.3093: tablabel_tooltip test fails with Athena
Bram Moolenaar <Bram@vim.org>
parents:
24268
diff
changeset
|
27 |
17089
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 working option. |
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 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
|
30 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
|
31 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
|
32 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
|
33 endif |
17089
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 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
|
35 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
|
36 endif |
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 endfunc |
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 |
19805
2dc5e6ddeb4c
patch 8.2.0459: cannot check if a function name is correct
Bram Moolenaar <Bram@vim.org>
parents:
19746
diff
changeset
|
39 " Command to check for the presence of a built-in function. |
17089
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 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
|
41 func CheckFunction(name) |
19805
2dc5e6ddeb4c
patch 8.2.0459: cannot check if a function name is correct
Bram Moolenaar <Bram@vim.org>
parents:
19746
diff
changeset
|
42 if !exists('?' .. a:name) |
2dc5e6ddeb4c
patch 8.2.0459: cannot check if a function name is correct
Bram Moolenaar <Bram@vim.org>
parents:
19746
diff
changeset
|
43 throw 'Checking for non-existent function ' .. a:name |
2dc5e6ddeb4c
patch 8.2.0459: cannot check if a function name is correct
Bram Moolenaar <Bram@vim.org>
parents:
19746
diff
changeset
|
44 endif |
17089
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
45 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
|
46 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
|
47 endif |
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
48 endfunc |
17557
4a22102fda8f
patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
49 |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
50 " 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
|
51 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
|
52 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
|
53 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
|
54 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
|
55 endif |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
56 endfunc |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
57 |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
58 " 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
|
59 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
|
60 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
|
61 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
|
62 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
|
63 endif |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
64 endfunc |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
65 |
20219
820f24dc1e3e
patch 8.2.0665: wrongly assuming Python executable is called "python"
Bram Moolenaar <Bram@vim.org>
parents:
20003
diff
changeset
|
66 " Command to check for the presence of python. Argument should have been |
820f24dc1e3e
patch 8.2.0665: wrongly assuming Python executable is called "python"
Bram Moolenaar <Bram@vim.org>
parents:
20003
diff
changeset
|
67 " obtained with PythonProg() |
820f24dc1e3e
patch 8.2.0665: wrongly assuming Python executable is called "python"
Bram Moolenaar <Bram@vim.org>
parents:
20003
diff
changeset
|
68 func CheckPython(name) |
820f24dc1e3e
patch 8.2.0665: wrongly assuming Python executable is called "python"
Bram Moolenaar <Bram@vim.org>
parents:
20003
diff
changeset
|
69 if a:name == '' |
820f24dc1e3e
patch 8.2.0665: wrongly assuming Python executable is called "python"
Bram Moolenaar <Bram@vim.org>
parents:
20003
diff
changeset
|
70 throw 'Skipped: python command not available' |
820f24dc1e3e
patch 8.2.0665: wrongly assuming Python executable is called "python"
Bram Moolenaar <Bram@vim.org>
parents:
20003
diff
changeset
|
71 endif |
820f24dc1e3e
patch 8.2.0665: wrongly assuming Python executable is called "python"
Bram Moolenaar <Bram@vim.org>
parents:
20003
diff
changeset
|
72 endfunc |
820f24dc1e3e
patch 8.2.0665: wrongly assuming Python executable is called "python"
Bram Moolenaar <Bram@vim.org>
parents:
20003
diff
changeset
|
73 |
17557
4a22102fda8f
patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
74 " 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
|
75 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
|
76 func CheckMSWindows() |
4a22102fda8f
patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
77 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
|
78 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
|
79 endif |
4a22102fda8f
patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
80 endfunc |
4a22102fda8f
patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
81 |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
82 " 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
|
83 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
|
84 func CheckNotMSWindows() |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
85 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
|
86 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
|
87 endif |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
88 endfunc |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
89 |
17557
4a22102fda8f
patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
90 " 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
|
91 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
|
92 func CheckUnix() |
4a22102fda8f
patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
93 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
|
94 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
|
95 endif |
4a22102fda8f
patch 8.1.1776: text added with a job isn't displayed
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
96 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
|
97 |
28317
d32dc906dd2c
patch 8.2.4684: cannot open a channel on a Unix domain socket
Bram Moolenaar <Bram@vim.org>
parents:
25986
diff
changeset
|
98 " Command to check for running on Linux |
24091
12a773f4f62f
patch 8.2.2587: recover test fails on FreeBSD
Bram Moolenaar <Bram@vim.org>
parents:
23766
diff
changeset
|
99 command CheckLinux call CheckLinux() |
12a773f4f62f
patch 8.2.2587: recover test fails on FreeBSD
Bram Moolenaar <Bram@vim.org>
parents:
23766
diff
changeset
|
100 func CheckLinux() |
12a773f4f62f
patch 8.2.2587: recover test fails on FreeBSD
Bram Moolenaar <Bram@vim.org>
parents:
23766
diff
changeset
|
101 if !has('linux') |
12a773f4f62f
patch 8.2.2587: recover test fails on FreeBSD
Bram Moolenaar <Bram@vim.org>
parents:
23766
diff
changeset
|
102 throw 'Skipped: only works on Linux' |
12a773f4f62f
patch 8.2.2587: recover test fails on FreeBSD
Bram Moolenaar <Bram@vim.org>
parents:
23766
diff
changeset
|
103 endif |
12a773f4f62f
patch 8.2.2587: recover test fails on FreeBSD
Bram Moolenaar <Bram@vim.org>
parents:
23766
diff
changeset
|
104 endfunc |
12a773f4f62f
patch 8.2.2587: recover test fails on FreeBSD
Bram Moolenaar <Bram@vim.org>
parents:
23766
diff
changeset
|
105 |
24268
9257f3980f4a
patch 8.2.2675: directory change in a terminal window shell is not followed
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
106 " Command to check for not running on a BSD system. |
9257f3980f4a
patch 8.2.2675: directory change in a terminal window shell is not followed
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
107 command CheckNotBSD call CheckNotBSD() |
9257f3980f4a
patch 8.2.2675: directory change in a terminal window shell is not followed
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
108 func CheckNotBSD() |
9257f3980f4a
patch 8.2.2675: directory change in a terminal window shell is not followed
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
109 if has('bsd') |
9257f3980f4a
patch 8.2.2675: directory change in a terminal window shell is not followed
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
110 throw 'Skipped: does not work on BSD' |
9257f3980f4a
patch 8.2.2675: directory change in a terminal window shell is not followed
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
111 endif |
9257f3980f4a
patch 8.2.2675: directory change in a terminal window shell is not followed
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
112 endfunc |
9257f3980f4a
patch 8.2.2675: directory change in a terminal window shell is not followed
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
113 |
30543
a1b4d1dae6b1
patch 9.0.0607: verbose echo message test fails on Mac OS
Bram Moolenaar <Bram@vim.org>
parents:
30457
diff
changeset
|
114 " Command to check for not running on a MacOS |
a1b4d1dae6b1
patch 9.0.0607: verbose echo message test fails on Mac OS
Bram Moolenaar <Bram@vim.org>
parents:
30457
diff
changeset
|
115 command CheckNotMac call CheckNotMac() |
a1b4d1dae6b1
patch 9.0.0607: verbose echo message test fails on Mac OS
Bram Moolenaar <Bram@vim.org>
parents:
30457
diff
changeset
|
116 func CheckNotMac() |
a1b4d1dae6b1
patch 9.0.0607: verbose echo message test fails on Mac OS
Bram Moolenaar <Bram@vim.org>
parents:
30457
diff
changeset
|
117 if has('mac') |
a1b4d1dae6b1
patch 9.0.0607: verbose echo message test fails on Mac OS
Bram Moolenaar <Bram@vim.org>
parents:
30457
diff
changeset
|
118 throw 'Skipped: does not work on MacOS' |
a1b4d1dae6b1
patch 9.0.0607: verbose echo message test fails on Mac OS
Bram Moolenaar <Bram@vim.org>
parents:
30457
diff
changeset
|
119 endif |
a1b4d1dae6b1
patch 9.0.0607: verbose echo message test fails on Mac OS
Bram Moolenaar <Bram@vim.org>
parents:
30457
diff
changeset
|
120 endfunc |
a1b4d1dae6b1
patch 9.0.0607: verbose echo message test fails on Mac OS
Bram Moolenaar <Bram@vim.org>
parents:
30457
diff
changeset
|
121 |
30457
7ab65e398be7
patch 9.0.0564: a few tests keep failing on MacOS M1
Bram Moolenaar <Bram@vim.org>
parents:
29473
diff
changeset
|
122 " Command to check for not running on a MacOS M1 system. |
7ab65e398be7
patch 9.0.0564: a few tests keep failing on MacOS M1
Bram Moolenaar <Bram@vim.org>
parents:
29473
diff
changeset
|
123 command CheckNotMacM1 call CheckNotMacM1() |
7ab65e398be7
patch 9.0.0564: a few tests keep failing on MacOS M1
Bram Moolenaar <Bram@vim.org>
parents:
29473
diff
changeset
|
124 func CheckNotMacM1() |
7ab65e398be7
patch 9.0.0564: a few tests keep failing on MacOS M1
Bram Moolenaar <Bram@vim.org>
parents:
29473
diff
changeset
|
125 if has('mac') && system('uname -a') =~ '\<arm64\>' |
7ab65e398be7
patch 9.0.0564: a few tests keep failing on MacOS M1
Bram Moolenaar <Bram@vim.org>
parents:
29473
diff
changeset
|
126 throw 'Skipped: does not work on MacOS M1' |
7ab65e398be7
patch 9.0.0564: a few tests keep failing on MacOS M1
Bram Moolenaar <Bram@vim.org>
parents:
29473
diff
changeset
|
127 endif |
7ab65e398be7
patch 9.0.0564: a few tests keep failing on MacOS M1
Bram Moolenaar <Bram@vim.org>
parents:
29473
diff
changeset
|
128 endfunc |
7ab65e398be7
patch 9.0.0564: a few tests keep failing on MacOS M1
Bram Moolenaar <Bram@vim.org>
parents:
29473
diff
changeset
|
129 |
17614
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
17557
diff
changeset
|
130 " 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
|
131 " 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
|
132 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
|
133 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
|
134 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
|
135 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
|
136 endif |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
17557
diff
changeset
|
137 endfunc |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
17557
diff
changeset
|
138 |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
17557
diff
changeset
|
139 " 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
|
140 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
|
141 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
|
142 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
|
143 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
|
144 endif |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
17557
diff
changeset
|
145 endfunc |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
146 |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
147 " 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
|
148 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
|
149 func CheckCanRunGui() |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
150 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
|
151 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
|
152 endif |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
153 endfunc |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
154 |
25143
54a547489e49
patch 8.2.3108: test for remote_foreground() fails
Bram Moolenaar <Bram@vim.org>
parents:
25112
diff
changeset
|
155 " Command to Check for an environment variable |
54a547489e49
patch 8.2.3108: test for remote_foreground() fails
Bram Moolenaar <Bram@vim.org>
parents:
25112
diff
changeset
|
156 command -nargs=1 CheckEnv call CheckEnv(<f-args>) |
54a547489e49
patch 8.2.3108: test for remote_foreground() fails
Bram Moolenaar <Bram@vim.org>
parents:
25112
diff
changeset
|
157 func CheckEnv(name) |
25145
cf18d6749dbe
patch 8.2.3109: check for $DISPLAY never fails
Bram Moolenaar <Bram@vim.org>
parents:
25143
diff
changeset
|
158 if empty(eval('$' .. a:name)) |
25143
54a547489e49
patch 8.2.3108: test for remote_foreground() fails
Bram Moolenaar <Bram@vim.org>
parents:
25112
diff
changeset
|
159 throw 'Skipped: Environment variable ' .. a:name .. ' is not set' |
54a547489e49
patch 8.2.3108: test for remote_foreground() fails
Bram Moolenaar <Bram@vim.org>
parents:
25112
diff
changeset
|
160 endif |
54a547489e49
patch 8.2.3108: test for remote_foreground() fails
Bram Moolenaar <Bram@vim.org>
parents:
25112
diff
changeset
|
161 endfunc |
54a547489e49
patch 8.2.3108: test for remote_foreground() fails
Bram Moolenaar <Bram@vim.org>
parents:
25112
diff
changeset
|
162 |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
163 " 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
|
164 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
|
165 func CheckGui() |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
166 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
|
167 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
|
168 endif |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
169 endfunc |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
170 |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
171 " 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
|
172 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
|
173 func CheckNotGui() |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
174 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
|
175 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
|
176 endif |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
177 endfunc |
18277
f6dcf7eabd26
patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
17668
diff
changeset
|
178 |
f6dcf7eabd26
patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
17668
diff
changeset
|
179 " 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
|
180 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
|
181 func CheckNotRoot() |
f6dcf7eabd26
patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
17668
diff
changeset
|
182 if IsRoot() |
f6dcf7eabd26
patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
17668
diff
changeset
|
183 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
|
184 endif |
f6dcf7eabd26
patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
17668
diff
changeset
|
185 endfunc |
19906
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19805
diff
changeset
|
186 |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19805
diff
changeset
|
187 " Command to check that the current language is English |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19805
diff
changeset
|
188 command CheckEnglish call CheckEnglish() |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19805
diff
changeset
|
189 func CheckEnglish() |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19805
diff
changeset
|
190 if v:lang != "C" && v:lang !~ '^[Ee]n' |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19805
diff
changeset
|
191 throw 'Skipped: only works in English language environment' |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19805
diff
changeset
|
192 endif |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19805
diff
changeset
|
193 endfunc |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19805
diff
changeset
|
194 |
20003
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
195 " Command to check that loopback device has IPv6 address |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
196 command CheckIPv6 call CheckIPv6() |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
197 func CheckIPv6() |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
198 if !has('ipv6') |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
199 throw 'Skipped: cannot use IPv6 networking' |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
200 endif |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
201 if !exists('s:ipv6_loopback') |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
202 let s:ipv6_loopback = s:CheckIPv6Loopback() |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
203 endif |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
204 if !s:ipv6_loopback |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
205 throw 'Skipped: no IPv6 address for loopback device' |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
206 endif |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
207 endfunc |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
208 |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
209 func s:CheckIPv6Loopback() |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
210 if has('win32') |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
211 return system('netsh interface ipv6 show interface') =~? '\<Loopback\>' |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
212 elseif filereadable('/proc/net/if_inet6') |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
213 return (match(readfile('/proc/net/if_inet6'), '\slo$') >= 0) |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
214 elseif executable('ifconfig') |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
215 for dev in ['lo0', 'lo', 'loop'] |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
216 " NOTE: On SunOS, need specify address family 'inet6' to get IPv6 info. |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
217 if system('ifconfig ' .. dev .. ' inet6 2>/dev/null') =~? '\<inet6\>' |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
218 \ || system('ifconfig ' .. dev .. ' 2>/dev/null') =~? '\<inet6\>' |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
219 return v:true |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
220 endif |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
221 endfor |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
222 else |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
223 " TODO: How to check it in other platforms? |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
224 endif |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
225 return v:false |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
226 endfunc |
e373843e2980
patch 8.2.0557: no IPv6 support for channels
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
227 |
23766
704fdd4d0949
patch 8.2.2424: some tests are known to cause an error with ASAN
Bram Moolenaar <Bram@vim.org>
parents:
20219
diff
changeset
|
228 " Command to check for not running under ASAN |
704fdd4d0949
patch 8.2.2424: some tests are known to cause an error with ASAN
Bram Moolenaar <Bram@vim.org>
parents:
20219
diff
changeset
|
229 command CheckNotAsan call CheckNotAsan() |
704fdd4d0949
patch 8.2.2424: some tests are known to cause an error with ASAN
Bram Moolenaar <Bram@vim.org>
parents:
20219
diff
changeset
|
230 func CheckNotAsan() |
704fdd4d0949
patch 8.2.2424: some tests are known to cause an error with ASAN
Bram Moolenaar <Bram@vim.org>
parents:
20219
diff
changeset
|
231 if execute('version') =~# '-fsanitize=[a-z,]*\<address\>' |
704fdd4d0949
patch 8.2.2424: some tests are known to cause an error with ASAN
Bram Moolenaar <Bram@vim.org>
parents:
20219
diff
changeset
|
232 throw 'Skipped: does not work with ASAN' |
704fdd4d0949
patch 8.2.2424: some tests are known to cause an error with ASAN
Bram Moolenaar <Bram@vim.org>
parents:
20219
diff
changeset
|
233 endif |
704fdd4d0949
patch 8.2.2424: some tests are known to cause an error with ASAN
Bram Moolenaar <Bram@vim.org>
parents:
20219
diff
changeset
|
234 endfunc |
704fdd4d0949
patch 8.2.2424: some tests are known to cause an error with ASAN
Bram Moolenaar <Bram@vim.org>
parents:
20219
diff
changeset
|
235 |
29253
5dd393285464
patch 8.2.5145: exit test causes spurious valgrind reports
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
236 " Command to check for not running under valgrind |
5dd393285464
patch 8.2.5145: exit test causes spurious valgrind reports
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
237 command CheckNotValgrind call CheckNotValgrind() |
5dd393285464
patch 8.2.5145: exit test causes spurious valgrind reports
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
238 func CheckNotValgrind() |
5dd393285464
patch 8.2.5145: exit test causes spurious valgrind reports
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
239 if RunningWithValgrind() |
5dd393285464
patch 8.2.5145: exit test causes spurious valgrind reports
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
240 throw 'Skipped: does not work well with valgrind' |
5dd393285464
patch 8.2.5145: exit test causes spurious valgrind reports
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
241 endif |
5dd393285464
patch 8.2.5145: exit test causes spurious valgrind reports
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
242 endfunc |
5dd393285464
patch 8.2.5145: exit test causes spurious valgrind reports
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
243 |
25986
34b75c77a7bd
patch 8.2.3526: tests have clumsy check for X11 based GUI
Bram Moolenaar <Bram@vim.org>
parents:
25145
diff
changeset
|
244 " Command to check for X11 based GUI |
34b75c77a7bd
patch 8.2.3526: tests have clumsy check for X11 based GUI
Bram Moolenaar <Bram@vim.org>
parents:
25145
diff
changeset
|
245 command CheckX11BasedGui call CheckX11BasedGui() |
34b75c77a7bd
patch 8.2.3526: tests have clumsy check for X11 based GUI
Bram Moolenaar <Bram@vim.org>
parents:
25145
diff
changeset
|
246 func CheckX11BasedGui() |
34b75c77a7bd
patch 8.2.3526: tests have clumsy check for X11 based GUI
Bram Moolenaar <Bram@vim.org>
parents:
25145
diff
changeset
|
247 if !g:x11_based_gui |
34b75c77a7bd
patch 8.2.3526: tests have clumsy check for X11 based GUI
Bram Moolenaar <Bram@vim.org>
parents:
25145
diff
changeset
|
248 throw 'Skipped: requires X11 based GUI' |
34b75c77a7bd
patch 8.2.3526: tests have clumsy check for X11 based GUI
Bram Moolenaar <Bram@vim.org>
parents:
25145
diff
changeset
|
249 endif |
34b75c77a7bd
patch 8.2.3526: tests have clumsy check for X11 based GUI
Bram Moolenaar <Bram@vim.org>
parents:
25145
diff
changeset
|
250 endfunc |
34b75c77a7bd
patch 8.2.3526: tests have clumsy check for X11 based GUI
Bram Moolenaar <Bram@vim.org>
parents:
25145
diff
changeset
|
251 |
29473
1c688281673d
patch 9.0.0078: star register is unexpectedly changed when deleting
Bram Moolenaar <Bram@vim.org>
parents:
29253
diff
changeset
|
252 " Command to check that there are two clipboards |
1c688281673d
patch 9.0.0078: star register is unexpectedly changed when deleting
Bram Moolenaar <Bram@vim.org>
parents:
29253
diff
changeset
|
253 command CheckTwoClipboards call CheckTwoClipboards() |
1c688281673d
patch 9.0.0078: star register is unexpectedly changed when deleting
Bram Moolenaar <Bram@vim.org>
parents:
29253
diff
changeset
|
254 func CheckTwoClipboards() |
1c688281673d
patch 9.0.0078: star register is unexpectedly changed when deleting
Bram Moolenaar <Bram@vim.org>
parents:
29253
diff
changeset
|
255 " avoid changing the clipboard here, only X11 supports both |
1c688281673d
patch 9.0.0078: star register is unexpectedly changed when deleting
Bram Moolenaar <Bram@vim.org>
parents:
29253
diff
changeset
|
256 if !has('X11') |
1c688281673d
patch 9.0.0078: star register is unexpectedly changed when deleting
Bram Moolenaar <Bram@vim.org>
parents:
29253
diff
changeset
|
257 throw 'Skipped: requires two clipboards' |
1c688281673d
patch 9.0.0078: star register is unexpectedly changed when deleting
Bram Moolenaar <Bram@vim.org>
parents:
29253
diff
changeset
|
258 endif |
1c688281673d
patch 9.0.0078: star register is unexpectedly changed when deleting
Bram Moolenaar <Bram@vim.org>
parents:
29253
diff
changeset
|
259 endfunc |
1c688281673d
patch 9.0.0078: star register is unexpectedly changed when deleting
Bram Moolenaar <Bram@vim.org>
parents:
29253
diff
changeset
|
260 |
24140
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
261 " Command to check for satisfying any of the conditions. |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
262 " e.g. CheckAnyOf Feature:bsd Feature:sun Linux |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
263 command -nargs=+ CheckAnyOf call CheckAnyOf(<f-args>) |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
264 func CheckAnyOf(...) |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
265 let excp = [] |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
266 for arg in a:000 |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
267 try |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
268 exe 'Check' .. substitute(arg, ':', ' ', '') |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
269 return |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
270 catch /^Skipped:/ |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
271 let excp += [substitute(v:exception, '^Skipped:\s*', '', '')] |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
272 endtry |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
273 endfor |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
274 throw 'Skipped: ' .. join(excp, '; ') |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
275 endfunc |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
276 |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
277 " Command to check for satisfying all of the conditions. |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
278 " e.g. CheckAllOf Unix Gui Option:ballooneval |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
279 command -nargs=+ CheckAllOf call CheckAllOf(<f-args>) |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
280 func CheckAllOf(...) |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
281 for arg in a:000 |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
282 exe 'Check' .. substitute(arg, ':', ' ', '') |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
283 endfor |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
284 endfunc |
af489e854955
patch 8.2.2611: conditions for startup tests are not exactly right
Bram Moolenaar <Bram@vim.org>
parents:
24091
diff
changeset
|
285 |
19906
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19805
diff
changeset
|
286 " vim: shiftwidth=2 sts=2 expandtab |