aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2018-12-29 01:15:59 -0500
committerJames McCoy <jamessan@jamessan.com>2018-12-29 12:57:16 -0500
commit91f40ff2841c4f3af524010145ee54d6d048ce07 (patch)
treed61ea59a69b63103179f41a2a796cc8518a5603f /test
parente09fb6ee534bf02535e4458cb6eb24aefb3aab24 (diff)
downloadrneovim-91f40ff2841c4f3af524010145ee54d6d048ce07.tar.gz
rneovim-91f40ff2841c4f3af524010145ee54d6d048ce07.tar.bz2
rneovim-91f40ff2841c4f3af524010145ee54d6d048ce07.zip
vim-patch:8.0.1734: package directory not added to 'rtp' if prefix matches
Problem: Package directory not added to 'rtp' if prefix matches. Solution: Check the match is a full match. (Ozaki Kiichi, closes vim/vim#2817) Also handle different ways of spelling a path. https://github.com/vim/vim/commit/f98a39ca57d001ba3e24831bae1e375790fb41f0
Diffstat (limited to 'test')
-rw-r--r--test/functional/legacy/packadd_spec.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua
index a73beef0cd..ca3757ad3c 100644
--- a/test/functional/legacy/packadd_spec.lua
+++ b/test/functional/legacy/packadd_spec.lua
@@ -57,6 +57,15 @@ describe('packadd', function()
call assert_match(Escape(s:plugdir) . '\($\|,\)', &rtp)
call assert_match(Escape(expand(s:plugdir . '/after$')), &rtp)
+ " NOTE: '/.../opt/myte' forwardly matches with '/.../opt/mytest'
+ call mkdir(fnamemodify(s:plugdir, ':h') . '/myte', 'p')
+ let rtp = &rtp
+ packadd myte
+
+ " Check the path of 'myte' is added
+ call assert_true(len(&rtp) > len(rtp))
+ call assert_match(Escape(s:plugdir) . '\($\|,\)', &rtp)
+
" Check exception
call assert_fails("packadd directorynotfound", 'E919:')
call assert_fails("packadd", 'E471:')