Commit: patch 9.2.0995: tests: no check that g:netrw_home has higher priority than $MYVIMDIR
Christian Brabandt <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <[email protected]> |
patch 9.2.0995: tests: no check that g:netrw_home has higher priority than $MYVIMDIR Commit: https://github.com/vim/vim/commit/b3526a91b82779c2d9e2f3ca330039143cc36862 Author: zeertzjq <[email protected]> Date: Sat Aug 22 16:02:16 2026 +0000 patch 9.2.0995: tests: no check that g:netrw_home has higher priority than $MYVIMDIR Problem: No check that g:netrw_home has higher priority than $MYVIMDIR. Solution: Set $MYVIMDIR to a different directory at the start of the test function. Also, s:NetrwHome() checks has('nvim') before exists('$MYVIMDIR'). This ordering does make sense as Nvim's docs have no mention of $MYVIMDIR. Match that in the test. closes: #21117 Signed-off-by: zeertzjq <[email protected]> Signed-off-by: Christian Brabandt <[email protected]> diff --git a/src/testdir/test_plugin_netrw.vim b/src/testdir/test_plugin_netrw.vim index db837aa8f..22d317156 100644 --- a/src/testdir/test_plugin_netrw.vim +++ b/src/testdir/test_plugin_netrw.vim @@ -920,15 +920,22 @@ endfunc func Test_netrw_home_setting() let save_home = get(g:, 'netrw_home', '') let dir = fnamemodify('XnetrwHome', ':p') + let vimdir = fnamemodify('XvimDir', ':p') let subdir = fnamemodify('XnetrwHomeParent/XnetrwHome', ':p') if has('win32') let dir = substitute(dir, '/', '\', 'g') + let vimdir = substitute(vimdir, '/', '\', 'g') let subdir = substitute(subdir, '/', '\', 'g') endif - + let save_myvimdir = getenv('MYVIMDIR') + let $MYVIMDIR = vimdir + + unlet! g:netrw_home if has('nvim') - unlet! g:netrw_home call assert_equal(netrw#fs#PathJoin(stdpath('state'), 'netrw'), Test_NetrwHome()) + else + " without the setting $MYVIMDIR is used + call assert_equal(vimdir, Test_NetrwHome()) endif let g:netrw_home = dir @@ -944,15 +951,12 @@ func Test_netrw_home_setting() let g:netrw_home = '$NETRW_TEST_HOME' call assert_equal(dir, Test_NetrwHome()) - " without the setting $MYVIMDIR is used - unlet g:netrw_home - let $MYVIMDIR = dir - call assert_equal(dir, Test_NetrwHome()) - call delete(dir, 'd') + call delete(vimdir, 'd') call delete(subdir, 'd') call delete(fnamemodify(subdir, ':h'), 'd') - let $NETRW_TEST_HOME = '' + unlet $NETRW_TEST_HOME + call setenv('MYVIMDIR', save_myvimdir) if empty(save_home) unlet! g:netrw_home else diff --git a/src/version.c b/src/version.c index 07c999989..e4aa7cd03 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 995, /**/ 994, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1wxoN6-00H5xj-5G%40256bit.org.