Mercurial > vim
annotate src/testdir/test_expand_dllpath.vim @ 27386:ccfb16d876b1 v8.2.4221
patch 8.2.4221: some functions in normal.c are very long
Commit: https://github.com/vim/vim/commit/a827bf3ea8fe465aa456ef7a7a37d6afe6a47628
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Wed Jan 26 12:14:15 2022 +0000
patch 8.2.4221: some functions in normal.c are very long
Problem: Some functions in normal.c are very long.
Solution: Move code to separate functions. (Yegappan Lakshmanan,
closes #9628)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 26 Jan 2022 13:15:03 +0100 |
parents | 08940efa6b4e |
children | dbec60b8c253 |
rev | line source |
---|---|
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
11862
diff
changeset
|
1 " Test for expanding dllpath options |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
11862
diff
changeset
|
2 |
8941
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func s:test_expand_dllpath(optname) |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 let $TEST_EXPAND_DLLPATH = '/dllpath/lib' . substitute(a:optname, '\zedll$', '.', '') |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 execute 'let dllpath_save = &' . a:optname |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 try |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 execute 'set ' . a:optname . '=$TEST_EXPAND_DLLPATH' |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 execute 'call assert_equal("' . $TEST_EXPAND_DLLPATH . '", &' . a:optname . ')' |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 execute 'set ' . a:optname . '=~' . $TEST_EXPAND_DLLPATH |
11862
18cda18a38e2
patch 8.0.0811: MS-Windows: test_expand_dllpath fails
Christian Brabandt <cb@256bit.org>
parents:
10966
diff
changeset
|
11 let home = substitute($HOME, '\\', '/', 'g') |
18cda18a38e2
patch 8.0.0811: MS-Windows: test_expand_dllpath fails
Christian Brabandt <cb@256bit.org>
parents:
10966
diff
changeset
|
12 execute 'call assert_equal("' . home . $TEST_EXPAND_DLLPATH . '", &' . a:optname . ')' |
8941
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 finally |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 execute 'let &' . a:optname . ' = dllpath_save' |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 let $TEST_EXPAND_DLLPATH = '' |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 endtry |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 endfunc |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 func s:generate_test_if_exists(optname) |
10966
398ad090256d
patch 8.0.0372: more options are not always defined
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
20 if exists('+' . a:optname) |
8941
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 execute join([ |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 \ 'func Test_expand_' . a:optname . '()', |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 \ ' call s:test_expand_dllpath("' . a:optname . '")', |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 \ 'endfunc' |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 \ ], "\n") |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 endif |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 endfunc |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 call s:generate_test_if_exists('luadll') |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 call s:generate_test_if_exists('perldll') |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 call s:generate_test_if_exists('pythondll') |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call s:generate_test_if_exists('pythonthreedll') |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 call s:generate_test_if_exists('rubydll') |
0e7b1897ceb3
commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 call s:generate_test_if_exists('tcldll') |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
11862
diff
changeset
|
35 |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
11862
diff
changeset
|
36 " vim: shiftwidth=2 sts=2 expandtab |