summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2024-04-16 22:18:15 +0200
committerChristian Brabandt <cb@256bit.org>2024-04-16 22:19:38 +0200
commit8560e6cf9797ea1d55ecaea6bf8ee8ec783c291a (patch)
tree388b668cf92f41f991e4e077fe8ccb64f681e570
parent9a90179a11b433fcbcf587182032222e229c6d75 (diff)
patch 9.1.0339: tests: xdg test uses screen dumpsv9.1.0339
Problem: tests: xdg test uses screen dumps Solution: Convert screen dump to normal test (Yegappan Lakshmanan) closes: #14564 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
-rw-r--r--src/testdir/dumps/Test_xdg_1.dump20
-rw-r--r--src/testdir/dumps/Test_xdg_2.dump20
-rw-r--r--src/testdir/dumps/Test_xdg_3.dump20
-rw-r--r--src/testdir/dumps/Test_xdg_4.dump20
-rw-r--r--src/testdir/test_xdg.vim112
-rw-r--r--src/version.c2
6 files changed, 60 insertions, 134 deletions
diff --git a/src/testdir/dumps/Test_xdg_1.dump b/src/testdir/dumps/Test_xdg_1.dump
deleted file mode 100644
index 4e1d7ebd45..0000000000
--- a/src/testdir/dumps/Test_xdg_1.dump
+++ /dev/null
@@ -1,20 +0,0 @@
-|~+0#4040ff13#ffffff0| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|r+0#0000000&|c|_|o|n|e| @16|o|n|e| @48
-|r|c| @20|.|v|i|m|r|c| @45
-|P+0#00e0003&|r|e|s@1| |E|N|T|E|R| |o|r| |t|y|p|e| |c|o|m@1|a|n|d| |t|o| |c|o|n|t|i|n|u|e> +0#0000000&@35
diff --git a/src/testdir/dumps/Test_xdg_2.dump b/src/testdir/dumps/Test_xdg_2.dump
deleted file mode 100644
index ebd3a632c9..0000000000
--- a/src/testdir/dumps/Test_xdg_2.dump
+++ /dev/null
@@ -1,20 +0,0 @@
-|~+0#4040ff13#ffffff0| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|r+0#0000000&|c|_|t|w|o| @16|t|w|o| @48
-|r|c| @20|.|v|i|m|/|v|i|m|r|c| @41
-|P+0#00e0003&|r|e|s@1| |E|N|T|E|R| |o|r| |t|y|p|e| |c|o|m@1|a|n|d| |t|o| |c|o|n|t|i|n|u|e> +0#0000000&@35
diff --git a/src/testdir/dumps/Test_xdg_3.dump b/src/testdir/dumps/Test_xdg_3.dump
deleted file mode 100644
index 72d0fbdd20..0000000000
--- a/src/testdir/dumps/Test_xdg_3.dump
+++ /dev/null
@@ -1,20 +0,0 @@
-|~+0#4040ff13#ffffff0| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|r+0#0000000&|c|_|t|h|r|e@1| @14|t|h|r|e@1| @46
-|r|c| @20|.|c|o|n|f|i|g|/|v|i|m|/|v|i|m|r|c| @34
-|P+0#00e0003&|r|e|s@1| |E|N|T|E|R| |o|r| |t|y|p|e| |c|o|m@1|a|n|d| |t|o| |c|o|n|t|i|n|u|e> +0#0000000&@35
diff --git a/src/testdir/dumps/Test_xdg_4.dump b/src/testdir/dumps/Test_xdg_4.dump
deleted file mode 100644
index 2a574a323c..0000000000
--- a/src/testdir/dumps/Test_xdg_4.dump
+++ /dev/null
@@ -1,20 +0,0 @@
-|~+0#4040ff13#ffffff0| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|r+0#0000000&|c|_|f|o|u|r| @15|f|o|u|r| @47
-|r|c| @20|x|d|g|/|v|i|m|/|v|i|m|r|c| @38
-|P+0#00e0003&|r|e|s@1| |E|N|T|E|R| |o|r| |t|y|p|e| |c|o|m@1|a|n|d| |t|o| |c|o|n|t|i|n|u|e> +0#0000000&@35
diff --git a/src/testdir/test_xdg.vim b/src/testdir/test_xdg.vim
index da98a2cfa7..557864e257 100644
--- a/src/testdir/test_xdg.vim
+++ b/src/testdir/test_xdg.vim
@@ -1,12 +1,9 @@
" Tests for the XDG feature
source check.vim
-CheckFeature terminal
source shared.vim
-source screendump.vim
source mouse.vim
-source term_util.vim
func s:get_rcs()
let rcs = {
@@ -77,63 +74,70 @@ func Test_xdg_runtime_files()
call writefile(file3, rc3)
call writefile(file4, rc4)
- let rows = 20
- let buf = RunVimInTerminal('', #{rows: rows, no_clean: 1})
- call TermWait(buf)
- call term_sendkeys(buf, ":echo \$MYVIMRC[-30:]\<cr>")
- call WaitForAssert({-> assert_match('XfakeHOME/\.vimrc', term_getline(buf, rows))})
- call term_sendkeys(buf, ":call filter(g:, {idx, _ -> idx =~ '^rc'})\<cr>")
- call TermWait(buf)
- call term_sendkeys(buf, ":redraw!\<cr>")
- call TermWait(buf)
- call term_sendkeys(buf, ":let g:\<cr>")
- call VerifyScreenDump(buf, 'Test_xdg_1', {})
- call StopVimInTerminal(buf)
+ " Get the Vim command to run without the '-u NONE' argument
+ let vimcmd = substitute(GetVimCommand(), '-u NONE', '', '')
+
+ " Test for ~/.vimrc
+ let lines =<< trim END
+ call assert_match('XfakeHOME/\.vimrc', $MYVIMRC)
+ call filter(g:, {idx, _ -> idx =~ '^rc'})
+ call assert_equal(#{rc_one: 'one', rc: '.vimrc'}, g:)
+ call writefile(v:errors, 'Xresult')
+ quit
+ END
+ call writefile(lines, 'Xscript', 'D')
+ call system($'{vimcmd} -S Xscript')
+ call assert_equal([], readfile('Xresult'))
+
call delete(rc1)
- bw
-
- let buf = RunVimInTerminal('', #{rows: rows, no_clean: 1})
- call TermWait(buf)
- call term_sendkeys(buf, ":echo \$MYVIMRC[-30:]\<cr>")
- call WaitForAssert({-> assert_match('XfakeHOME/\.vim/vimrc', term_getline(buf, rows))})
- call term_sendkeys(buf, ":call filter(g:, {idx, _ -> idx =~ '^rc'})\<cr>")
- call TermWait(buf)
- call term_sendkeys(buf, ":redraw!\<cr>")
- call TermWait(buf)
- call term_sendkeys(buf, ":let g:\<cr>")
- call VerifyScreenDump(buf, 'Test_xdg_2', {})
- call StopVimInTerminal(buf)
+
+ " Test for ~/.vim/vimrc
+ let lines =<< trim END
+ call assert_match('XfakeHOME/\.vim/vimrc', $MYVIMRC)
+ call filter(g:, {idx, _ -> idx =~ '^rc'})
+ call assert_equal(#{rc_two: 'two', rc: '.vim/vimrc'}, g:)
+ call writefile(v:errors, 'Xresult')
+ quit
+ END
+ call writefile(lines, 'Xscript', 'D')
+ call system($'{vimcmd} -S Xscript')
+ call assert_equal([], readfile('Xresult'))
+
call delete(rc2)
- bw
-
- let buf = RunVimInTerminal('', #{rows: rows, no_clean: 1})
- call TermWait(buf)
- call term_sendkeys(buf, ":echo \$MYVIMRC[-30:]\<cr>")
- call WaitForAssert({-> assert_match('XfakeHOME/\.config/vim/vimrc', term_getline(buf, rows))})
- call term_sendkeys(buf, ":call filter(g:, {idx, _ -> idx =~ '^rc'})\<cr>")
- call TermWait(buf)
- call term_sendkeys(buf, ":redraw!\<cr>")
- call TermWait(buf)
- call term_sendkeys(buf, ":let g:\<cr>")
- call VerifyScreenDump(buf, 'Test_xdg_3', {})
- call StopVimInTerminal(buf)
+
+ " XDG_CONFIG_HOME is set in Github CI runners
+ unlet $XDG_CONFIG_HOME
+
+ " Test for ~/.config/vim/vimrc
+ let lines =<< trim END
+ let msg = $'HOME="{$HOME}", ~="{expand("~")}"'
+ call assert_match('XfakeHOME/\.config/vim/vimrc', $MYVIMRC, msg)
+ call filter(g:, {idx, _ -> idx =~ '^rc'})
+ call assert_equal(#{rc_three: 'three', rc: '.config/vim/vimrc'}, g:)
+ call writefile(v:errors, 'Xresult')
+ quit
+ END
+ call writefile(lines, 'Xscript', 'D')
+ call system($'{vimcmd} -S Xscript')
+ call assert_equal([], readfile('Xresult'))
+
call delete(rc3)
- bw
+ " Test for ~/xdg/vim/vimrc
let $XDG_CONFIG_HOME=expand('~/xdg/')
- let buf = RunVimInTerminal('', #{rows: rows, no_clean: 1})
- call TermWait(buf)
- call term_sendkeys(buf, ":redraw!\<cr>")
- call TermWait(buf)
- call term_sendkeys(buf, ":echo \$MYVIMRC[-30:]\<cr>")
- call WaitForAssert({-> assert_match('XfakeHOME/xdg/vim/vimrc', term_getline(buf, rows))})
- call term_sendkeys(buf, ":call filter(g:, {idx, _ -> idx =~ '^rc'})\<cr>")
- call TermWait(buf)
- call term_sendkeys(buf, ":let g:\<cr>")
- call VerifyScreenDump(buf, 'Test_xdg_4', {})
- call StopVimInTerminal(buf)
+ let lines =<< trim END
+ let msg = $'HOME="{$HOME}", XDG_CONFIG_HOME="{$XDG_CONFIG_HOME}"'
+ call assert_match('XfakeHOME/xdg/vim/vimrc', $MYVIMRC, msg)
+ call filter(g:, {idx, _ -> idx =~ '^rc'})
+ call assert_equal(#{rc_four: 'four', rc: 'xdg/vim/vimrc'}, g:)
+ call writefile(v:errors, 'Xresult')
+ quit
+ END
+ call writefile(lines, 'Xscript', 'D')
+ call system($'{vimcmd} -S Xscript')
+ call assert_equal([], readfile('Xresult'))
+
call delete(rc4)
- bw
unlet $XDG_CONFIG_HOME
endfunc
diff --git a/src/version.c b/src/version.c
index d11f808484..475f288d03 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 339,
+/**/
338,
/**/
337,