commit 0eb708aa8a1af8bec8486ddceb10c2cd515b0ca0
parent bd0555ecd49750db87f3cfd07b44ca9640f96619
Author: zeertzjq <zeertzjq@outlook.com>
Date: Fri, 18 Apr 2025 08:05:36 +0800
vim-patch:9.1.0721: tests: test_mksession does not consider XDG_CONFIG_HOME
Problem: tests: test_mksession does not consider XDG_CONFIG_HOME
Solution: allow to match $HOME/.vim/ and $HOME/.config/vim for &viewdir
(John M Devin)
closes: vim/vim#15639
https://github.com/vim/vim/commit/5b9237c2e7613f126f95e26056f55024af759102
Co-authored-by: John M Devin <john.m.devin@gmail.com>
Diffstat:
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/test/old/testdir/setup.vim b/test/old/testdir/setup.vim
@@ -114,6 +114,10 @@ endif
" defaults before we get here, and test_mksession checks that.
let $ORIGHOME = $HOME
+if !exists('$XDG_CONFIG_HOME')
+ let $XDG_CONFIG_HOME = $HOME .. '/.config'
+endif
+
" Make sure $HOME does not get read or written.
let $HOME = expand(getcwd() . '/XfakeHOME')
if !isdirectory($HOME)
diff --git a/test/old/testdir/test_mksession.vim b/test/old/testdir/test_mksession.vim
@@ -1205,7 +1205,10 @@ func Test_mkview_default_home()
" use escape() to handle backslash path separators
call assert_match('^' .. escape($ORIGHOME, '\') .. '/vimfiles', &viewdir)
elseif has('unix')
- call assert_match('^' .. $ORIGHOME .. '/.vim', &viewdir)
+ call assert_match(
+ \ '^' .. $ORIGHOME .. '/.vim\|' ..
+ \ '^' .. $XDG_CONFIG_HOME .. '/vim'
+ \ , &viewdir)
elseif has('amiga')
call assert_match('^home:vimfiles', &viewdir)
elseif has('mac')