diff options
Diffstat (limited to 'test/functional/legacy/packadd_spec.lua')
| -rw-r--r-- | test/functional/legacy/packadd_spec.lua | 33 | 
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()  | 
