annotate src/testdir/test_expand_dllpath.vim @ 8941:0e7b1897ceb3 v7.4.1756

commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 20 16:19:52 2016 +0200 patch 7.4.1756 Problem: "dll" options are not expanded. Solution: Expand environment variables. (Ozaki Kiichi)
author Christian Brabandt <cb@256bit.org>
date Wed, 20 Apr 2016 16:30:06 +0200
parents
children 81ba6e4eb72b
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 scriptencoding utf-8
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
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
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 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
12 finally
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 execute 'let &' . a:optname . ' = dllpath_save'
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 let $TEST_EXPAND_DLLPATH = ''
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 endtry
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 endfunc
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 func s:generate_test_if_exists(optname)
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 if exists('&' . a:optname)
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 execute join([
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 \ 'func Test_expand_' . a:optname . '()',
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \ ' call s:test_expand_dllpath("' . a:optname . '")',
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 \ 'endfunc'
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 \ ], "\n")
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 endif
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 endfunc
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 call s:generate_test_if_exists('luadll')
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 call s:generate_test_if_exists('perldll')
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 call s:generate_test_if_exists('pythondll')
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 call s:generate_test_if_exists('pythonthreedll')
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 call s:generate_test_if_exists('rubydll')
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 call s:generate_test_if_exists('tcldll')