annotate src/testdir/test_expand_dllpath.vim @ 10966:398ad090256d v8.0.0372

patch 8.0.0372: more options are not always defined commit https://github.com/vim/vim/commit/a713ff819d134dc34e507c05273c935bfc17e795 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 25 22:18:43 2017 +0100 patch 8.0.0372: more options are not always defined Problem: More options are not always defined. Solution: Consistently define all possible options.
author Christian Brabandt <cb@256bit.org>
date Sat, 25 Feb 2017 22:30:04 +0100
parents 81ba6e4eb72b
children 18cda18a38e2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8941
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 func s:test_expand_dllpath(optname)
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 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
3 execute 'let dllpath_save = &' . a:optname
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 try
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 execute 'set ' . a:optname . '=$TEST_EXPAND_DLLPATH'
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 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
7
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 execute 'set ' . a:optname . '=~' . $TEST_EXPAND_DLLPATH
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 execute 'call assert_equal("' . $HOME . $TEST_EXPAND_DLLPATH . '", &' . a:optname . ')'
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 finally
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 execute 'let &' . a:optname . ' = dllpath_save'
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 let $TEST_EXPAND_DLLPATH = ''
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 endtry
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 endfunc
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 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
17 if exists('+' . a:optname)
8941
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 execute join([
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 \ 'func Test_expand_' . a:optname . '()',
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 \ ' call s:test_expand_dllpath("' . a:optname . '")',
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 \ 'endfunc'
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \ ], "\n")
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 endif
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
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 call s:generate_test_if_exists('luadll')
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 call s:generate_test_if_exists('perldll')
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 call s:generate_test_if_exists('pythondll')
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 call s:generate_test_if_exists('pythonthreedll')
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 call s:generate_test_if_exists('rubydll')
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 call s:generate_test_if_exists('tcldll')