aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/packadd_spec.lua
diff options
context:
space:
mode:
authorb-r-o-c-k <brockmammen@gmail.com>2018-04-14 14:17:51 -0500
committerb-r-o-c-k <brockmammen@gmail.com>2018-04-14 14:17:51 -0500
commitad999eaa775d7d4b0cacedb30c6ea3a0ee699a6f (patch)
tree92de2079e80f5f289dd87a54af123cb7d90c3058 /test/functional/legacy/packadd_spec.lua
parent78bc52ea5397c092d01cd08296fe1dc85d998329 (diff)
parentef4feab0e75be19c5f41d70a001db980b72090f5 (diff)
downloadrneovim-ad999eaa775d7d4b0cacedb30c6ea3a0ee699a6f.tar.gz
rneovim-ad999eaa775d7d4b0cacedb30c6ea3a0ee699a6f.tar.bz2
rneovim-ad999eaa775d7d4b0cacedb30c6ea3a0ee699a6f.zip
Merge branch 'master' into s-dash-stdin
Diffstat (limited to 'test/functional/legacy/packadd_spec.lua')
-rw-r--r--test/functional/legacy/packadd_spec.lua33
1 files changed, 16 insertions, 17 deletions
diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua
index 2dfd36142b..fb308475c0 100644
--- a/test/functional/legacy/packadd_spec.lua
+++ b/test/functional/legacy/packadd_spec.lua
@@ -9,17 +9,15 @@ local function expected_empty()
eq({}, nvim.get_vvar('errors'))
end
-if helpers.pending_win32(pending) then return end
-
describe('packadd', function()
before_each(function()
clear()
source([=[
func SetUp()
- let s:topdir = expand('%:p:h') . '/Xdir'
+ let s:topdir = expand(expand('%:p:h') . '/Xdir')
exe 'set packpath=' . s:topdir
- let s:plugdir = s:topdir . '/pack/mine/opt/mytest'
+ let s:plugdir = expand(s:topdir . '/pack/mine/opt/mytest')
endfunc
func TearDown()
@@ -52,8 +50,8 @@ describe('packadd', function()
call assert_equal(77, g:plugin_also_works)
call assert_true(17, g:ftdetect_works)
call assert_true(len(&rtp) > len(rtp))
- call assert_true(&rtp =~ (s:plugdir . '\($\|,\)'))
- call assert_true(&rtp =~ (s:plugdir . '/after$'))
+ call assert_true(&rtp =~ (escape(s:plugdir, '\') . '\($\|,\)'))
+ call assert_true(&rtp =~ escape(expand(s:plugdir . '/after$'), '\'))
" Check exception
call assert_fails("packadd directorynotfound", 'E919:')
@@ -74,7 +72,7 @@ describe('packadd', function()
packadd! mytest
call assert_true(len(&rtp) > len(rtp))
- call assert_true(&rtp =~ (s:plugdir . '\($\|,\)'))
+ call assert_true(&rtp =~ (escape(s:plugdir, '\') . '\($\|,\)'))
call assert_equal(0, g:plugin_works)
" check the path is not added twice
@@ -84,17 +82,18 @@ describe('packadd', function()
endfunc
func Test_packadd_symlink_dir()
- if !has('unix')
- return
- endif
- let top2_dir = s:topdir . '/Xdir2'
- let real_dir = s:topdir . '/Xsym'
+ let top2_dir = expand(s:topdir . '/Xdir2')
+ let real_dir = expand(s:topdir . '/Xsym')
call mkdir(real_dir, 'p')
- exec "silent! !ln -s Xsym" top2_dir
- let &rtp = top2_dir . ',' . top2_dir . '/after'
+ if has('win32')
+ exec "silent! !mklink /d" top2_dir "Xsym"
+ else
+ exec "silent! !ln -s Xsym" top2_dir
+ endif
+ let &rtp = top2_dir . ',' . expand(top2_dir . '/after')
let &packpath = &rtp
- let s:plugdir = top2_dir . '/pack/mine/opt/mytest'
+ let s:plugdir = expand(top2_dir . '/pack/mine/opt/mytest')
call mkdir(s:plugdir . '/plugin', 'p')
exe 'split ' . s:plugdir . '/plugin/test.vim'
@@ -105,7 +104,7 @@ describe('packadd', function()
packadd mytest
" Must have been inserted in the middle, not at the end
- call assert_true(&rtp =~ '/pack/mine/opt/mytest,')
+ call assert_true(&rtp =~ escape(expand('/pack/mine/opt/mytest').',', '\'))
call assert_equal(44, g:plugin_works)
" No change when doing it again.
@@ -115,7 +114,7 @@ describe('packadd', function()
set rtp&
let rtp = &rtp
- exec "silent !rm" top2_dir
+ exec "silent !" (has('win32') ? "rd /q/s" : "rm") top2_dir
endfunc
func Test_packloadall()