aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2017-10-13 11:18:49 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-02-19 07:10:42 -0500
commite55de56a99ac74d30665af6ab400e759ed8b3b40 (patch)
treee4fffc3e4343d7e7816accd028f998fb2ce9a465
parentf4d82c1438c2197d893f678b2fc66cc5dcbc6447 (diff)
downloadrneovim-e55de56a99ac74d30665af6ab400e759ed8b3b40.tar.gz
rneovim-e55de56a99ac74d30665af6ab400e759ed8b3b40.tar.bz2
rneovim-e55de56a99ac74d30665af6ab400e759ed8b3b40.zip
win: enable 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()