Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
8940:6510e51d1992 | 8941:0e7b1897ceb3 |
---|---|
1 scriptencoding utf-8 | |
2 | |
3 func s:test_expand_dllpath(optname) | |
4 let $TEST_EXPAND_DLLPATH = '/dllpath/lib' . substitute(a:optname, '\zedll$', '.', '') | |
5 execute 'let dllpath_save = &' . a:optname | |
6 try | |
7 execute 'set ' . a:optname . '=$TEST_EXPAND_DLLPATH' | |
8 execute 'call assert_equal("' . $TEST_EXPAND_DLLPATH . '", &' . a:optname . ')' | |
9 | |
10 execute 'set ' . a:optname . '=~' . $TEST_EXPAND_DLLPATH | |
11 execute 'call assert_equal("' . $HOME . $TEST_EXPAND_DLLPATH . '", &' . a:optname . ')' | |
12 finally | |
13 execute 'let &' . a:optname . ' = dllpath_save' | |
14 let $TEST_EXPAND_DLLPATH = '' | |
15 endtry | |
16 endfunc | |
17 | |
18 func s:generate_test_if_exists(optname) | |
19 if exists('&' . a:optname) | |
20 execute join([ | |
21 \ 'func Test_expand_' . a:optname . '()', | |
22 \ ' call s:test_expand_dllpath("' . a:optname . '")', | |
23 \ 'endfunc' | |
24 \ ], "\n") | |
25 endif | |
26 endfunc | |
27 | |
28 call s:generate_test_if_exists('luadll') | |
29 call s:generate_test_if_exists('perldll') | |
30 call s:generate_test_if_exists('pythondll') | |
31 call s:generate_test_if_exists('pythonthreedll') | |
32 call s:generate_test_if_exists('rubydll') | |
33 call s:generate_test_if_exists('tcldll') |