Mercurial > vim
annotate src/testdir/test_expand_dllpath.vim @ 9994:ee8b8a670a5c v7.4.2270
commit https://github.com/vim/vim/commit/821179809d9b0f65177360b53584be2b4039dd46
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 27 19:21:48 2016 +0200
patch 7.4.2270
Problem: Insufficient testing for NUL bytes on a raw channel.
Solution: Add a test for writing and reading.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 27 Aug 2016 19:30:06 +0200 |
parents | 81ba6e4eb72b |
children | 398ad090256d |
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') |