summaryrefslogtreecommitdiff
path: root/src/testdir/test_expand_dllpath.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-04-20 16:19:52 +0200
committerBram Moolenaar <Bram@vim.org>2016-04-20 16:19:52 +0200
commita6e42501424f6670fa864c739d2dc2eb764900b9 (patch)
tree19311053d3b8c596d1c9a261ea53367b4dc2f665 /src/testdir/test_expand_dllpath.vim
parent517ffbee0d5b7b46320726faaa330b61f54e867c (diff)
downloadvim-git-a6e42501424f6670fa864c739d2dc2eb764900b9.tar.gz
patch 7.4.1756v7.4.1756
Problem: "dll" options are not expanded. Solution: Expand environment variables. (Ozaki Kiichi)
Diffstat (limited to 'src/testdir/test_expand_dllpath.vim')
-rw-r--r--src/testdir/test_expand_dllpath.vim33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/testdir/test_expand_dllpath.vim b/src/testdir/test_expand_dllpath.vim
new file mode 100644
index 000000000..e69e7e1b3
--- /dev/null
+++ b/src/testdir/test_expand_dllpath.vim
@@ -0,0 +1,33 @@
+scriptencoding utf-8
+
+func s:test_expand_dllpath(optname)
+ let $TEST_EXPAND_DLLPATH = '/dllpath/lib' . substitute(a:optname, '\zedll$', '.', '')
+ execute 'let dllpath_save = &' . a:optname
+ try
+ execute 'set ' . a:optname . '=$TEST_EXPAND_DLLPATH'
+ execute 'call assert_equal("' . $TEST_EXPAND_DLLPATH . '", &' . a:optname . ')'
+
+ execute 'set ' . a:optname . '=~' . $TEST_EXPAND_DLLPATH
+ execute 'call assert_equal("' . $HOME . $TEST_EXPAND_DLLPATH . '", &' . a:optname . ')'
+ finally
+ execute 'let &' . a:optname . ' = dllpath_save'
+ let $TEST_EXPAND_DLLPATH = ''
+ endtry
+endfunc
+
+func s:generate_test_if_exists(optname)
+ if exists('&' . a:optname)
+ execute join([
+ \ 'func Test_expand_' . a:optname . '()',
+ \ ' call s:test_expand_dllpath("' . a:optname . '")',
+ \ 'endfunc'
+ \ ], "\n")
+ endif
+endfunc
+
+call s:generate_test_if_exists('luadll')
+call s:generate_test_if_exists('perldll')
+call s:generate_test_if_exists('pythondll')
+call s:generate_test_if_exists('pythonthreedll')
+call s:generate_test_if_exists('rubydll')
+call s:generate_test_if_exists('tcldll')