Commit: patch 9.1.0721: tests: test_mksession does not consider XDG_CONFIG_HOME

3 views
Skip to first unread message

Christian Brabandt

unread,
Sep 8, 2024, 2:15:10 PM9/8/24
to vim...@googlegroups.com
patch 9.1.0721: tests: test_mksession does not consider XDG_CONFIG_HOME

Commit: https://github.com/vim/vim/commit/5b9237c2e7613f126f95e26056f55024af759102
Author: John M Devin <john.m...@gmail.com>
Date: Sun Sep 8 20:00:38 2024 +0200

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: #15639

Signed-off-by: John M Devin <john.m...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/testdir/setup.vim b/src/testdir/setup.vim
index 0e5088ad2..485675aa3 100644
--- a/src/testdir/setup.vim
+++ b/src/testdir/setup.vim
@@ -34,6 +34,10 @@ if 1
" 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.
" It must exist, gnome tries to create $HOME/.gnome2
let $HOME = getcwd() . '/XfakeHOME'
diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim
index 914d1e3a4..d0ee6e8a7 100644
--- a/src/testdir/test_mksession.vim
+++ b/src/testdir/test_mksession.vim
@@ -1270,7 +1270,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')
diff --git a/src/version.c b/src/version.c
index 5c3c5efb6..eb88b0d91 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 721,
/**/
720,
/**/
Reply all
Reply to author
Forward
0 new messages