annotate src/testdir/test_expand_dllpath.vim @ 9618:81ba6e4eb72b v7.4.2086

commit https://github.com/vim/vim/commit/ac105ed3c420660ddbddc501c97875c48220817e Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 21 20:33:32 2016 +0200 patch 7.4.2086 Problem: Using the system default encoding makes tests unpredictable. Solution: Always use utf-8 or latin1 in the new style tests. Remove setting encoding and scriptencoding where it is not needed.
author Christian Brabandt <cb@256bit.org>
date Thu, 21 Jul 2016 20:45:06 +0200
parents 0e7b1897ceb3
children 398ad090256d
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)
0e7b1897ceb3 commit https://github.com/vim/vim/commit/a6e42501424f6670fa864c739d2dc2eb764900b9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 if exists('&' . a:optname)
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')