diff src/testdir/test_packadd.vim @ 13724:5ef1e6170589 v8.0.1734

patch 8.0.1734: package directory not added to 'rtp' if prefix matches commit https://github.com/vim/vim/commit/f98a39ca57d001ba3e24831bae1e375790fb41f0 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 18 22:18:23 2018 +0200 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 https://github.com/vim/vim/issues/2817) Also handle different ways of spelling a path.
author Christian Brabandt <cb@256bit.org>
date Wed, 18 Apr 2018 22:30:07 +0200
parents 9fccd578ce1f
children 285b051979a6
line wrap: on
line diff
--- a/src/testdir/test_packadd.vim
+++ b/src/testdir/test_packadd.vim
@@ -40,6 +40,15 @@ func Test_packadd()
   call assert_match('/testdir/Xdir/pack/mine/opt/mytest\($\|,\)', &rtp)
   call assert_match('/testdir/Xdir/pack/mine/opt/mytest/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('/testdir/Xdir/pack/mine/opt/myte\($\|,\)', &rtp)
+
   " Check exception
   call assert_fails("packadd directorynotfound", 'E919:')
   call assert_fails("packadd", 'E471:')