From 7afc17dec17bcc40c646b796f05d373e46916dd7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 23 Aug 2022 13:03:00 +0800 Subject: vim-patch:8.2.4741: startup test fails Problem: Startup test fails. Solution: Avoid an error for verbose expansion. Fix that the "0verbose" command modifier doesn't work. https://github.com/vim/vim/commit/60895f3e36def9beb7d5463e792e5154ad9a7a0a Most code changes has already been ported. --- src/nvim/testdir/test_excmd.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/nvim/testdir/test_excmd.vim') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim index dac7a6989d..9a9e5c546b 100644 --- a/src/nvim/testdir/test_excmd.vim +++ b/src/nvim/testdir/test_excmd.vim @@ -568,10 +568,12 @@ endfunc " Test for the :verbose command func Test_verbose_cmd() - call assert_equal([' verbose=1'], split(execute('verbose set vbs'), "\n")) + set verbose=3 + call assert_match(' verbose=1\n\s*Last set from ', execute('verbose set vbs'), "\n") call assert_equal([' verbose=0'], split(execute('0verbose set vbs'), "\n")) - let l = execute("4verbose set verbose | set verbose") - call assert_equal([' verbose=4', ' verbose=0'], split(l, "\n")) + set verbose=0 + call assert_match(' verbose=4\n\s*Last set from .*\n verbose=0', + \ execute("4verbose set verbose | set verbose")) endfunc " Test for the :delete command and the related abbreviated commands -- cgit From 89b9eab638d5e6467156c25f0d54df48d861ca16 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 15 Sep 2022 11:36:13 +0800 Subject: test(old): remove OpenBSD skip (#20201) --- src/nvim/testdir/test_excmd.vim | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/testdir/test_excmd.vim') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim index 9a9e5c546b..caa9b76fda 100644 --- a/src/nvim/testdir/test_excmd.vim +++ b/src/nvim/testdir/test_excmd.vim @@ -230,7 +230,6 @@ endfunc " Test for the :language command func Test_language_cmd() CheckNotMSWindows " FIXME: why does this fail on Windows CI? - CheckNotBSD " FIXME: why does this fail on OpenBSD CI? CheckFeature multi_lang call assert_fails('language ctype non_existing_lang', 'E197:') -- cgit From dd2b7586f36ab10232d9024ddf2dfb436518269e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 22 Sep 2022 10:48:46 +0800 Subject: vim-patch:8.2.2979: not all options code is covered by tests Problem: Not all options code is covered by tests. Solution: Add more tests for options. (Yegappan Lakshmanan, closes vim/vim#8369) https://github.com/vim/vim/commit/5958549760652c173b703613b9cbf09b25a4eddb --- src/nvim/testdir/test_excmd.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/testdir/test_excmd.vim') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim index caa9b76fda..f6ff1b5dc9 100644 --- a/src/nvim/testdir/test_excmd.vim +++ b/src/nvim/testdir/test_excmd.vim @@ -662,6 +662,12 @@ func Sandbox_tests() if has('unix') call assert_fails('cd `pwd`', 'E48:') endif + " some options cannot be changed in a sandbox + call assert_fails('set exrc', 'E48:') + call assert_fails('set cdpath', 'E48:') + if has('xim') + call assert_fails('set imstyle', 'E48:') + endif endfunc func Test_sandbox() -- cgit From 88099c11223398b2e7eb96eaa9385d24046db994 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 22 Sep 2022 11:17:41 +0800 Subject: vim-patch:8.2.2994: various code is not fully tested Problem: Various code is not fully tested. Solution: Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8378) https://github.com/vim/vim/commit/2d6d718dde7163c971d37b8f4f1ed8f2d25de130 Nvim does not support encoding=latin1 or compatible mode. The two paste tests are applicable. --- src/nvim/testdir/test_excmd.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_excmd.vim') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim index f6ff1b5dc9..7692d4fc55 100644 --- a/src/nvim/testdir/test_excmd.vim +++ b/src/nvim/testdir/test_excmd.vim @@ -665,7 +665,7 @@ func Sandbox_tests() " some options cannot be changed in a sandbox call assert_fails('set exrc', 'E48:') call assert_fails('set cdpath', 'E48:') - if has('xim') + if has('xim') && has('gui_gtk') call assert_fails('set imstyle', 'E48:') endif endfunc -- cgit From d40739843cf9a160587032bf381c440079e5a8ce Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 26 Oct 2022 13:05:33 +0800 Subject: vim-patch:8.2.0401: not enough test coverage for evalvars.c Problem: Not enough test coverage for evalvars.c. Solution: Add more tests. (Yegappan Lakshmanan, closes vim/vim#5804) https://github.com/vim/vim/commit/8dfcce3a78ccb520cc9d09081f998091494c50bf Assert E475 instead of E474 in :redir test because a later patch changed the error number. Comment out the test for :echo with a deeply nested container as Nvim implements :echo very differently. --- src/nvim/testdir/test_excmd.vim | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/nvim/testdir/test_excmd.vim') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim index 7692d4fc55..acf23fbc3c 100644 --- a/src/nvim/testdir/test_excmd.vim +++ b/src/nvim/testdir/test_excmd.vim @@ -479,12 +479,21 @@ endfunc func Test_redir_cmd() call assert_fails('redir @@', 'E475:') call assert_fails('redir abc', 'E475:') + call assert_fails('redir => 1abc', 'E474:') + call assert_fails('redir => a b', 'E488:') + call assert_fails('redir => abc[1]', 'E475:') + let b=0zFF + call assert_fails('redir =>> b', 'E734:') + unlet b + if has('unix') + " Redirecting to a directory name call mkdir('Xdir') call assert_fails('redir > Xdir', 'E17:') call delete('Xdir', 'd') endif if !has('bsd') + " Redirecting to a read-only file call writefile([], 'Xfile') call setfperm('Xfile', 'r--r--r--') call assert_fails('redir! > Xfile', 'E190:') -- cgit From 624f6a8ca012dd6d27f1e67ace6ef10d04c5625f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 27 Oct 2022 07:53:54 +0800 Subject: vim-patch:8.2.2837: various code lines not covered by tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Various code lines not covered by tests. Solution: Add test cases. (Dominique Pellé, closes vim/vim#8178) https://github.com/vim/vim/commit/6d37e8e3baafba460bd2d051170d213c1ba9a523 Co-authored-by: Dominique Pelle --- src/nvim/testdir/test_excmd.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/testdir/test_excmd.vim') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim index acf23fbc3c..04ab8e288f 100644 --- a/src/nvim/testdir/test_excmd.vim +++ b/src/nvim/testdir/test_excmd.vim @@ -683,6 +683,12 @@ func Test_sandbox() sandbox call Sandbox_tests() endfunc +func Test_command_not_implemented_E319() + if !has('mzscheme') + call assert_fails('mzscheme', 'E319:') + endif +endfunc + func Test_not_break_expression_register() call setreg('=', '1+1') if 0 -- cgit From 8b0c5de4e0964109326a0befb1b3bff6aac4d0db Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 5 Nov 2022 07:24:06 +0800 Subject: vim-patch:partial:8.2.1183: assert_fails() checks the last error message Problem: assert_fails() checks the last error message. Solution: Check the first error, it is more relevant. Fix all the tests that rely on the old behavior. https://github.com/vim/vim/commit/9b7bf9e98f06ece595fed7a3ff53ecce89797a53 Skip test_listener.vim, test_textprop.vim, test_viminfo.vim. Skip test_python2.vim: affected line fails and hasn't been ported. Skip test_python3.vim: affected lines fail and haven't been ported. Skip CHECK_LIST_MATERIALIZE. Co-authored-by: Bram Moolenaar --- src/nvim/testdir/test_excmd.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir/test_excmd.vim') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim index 04ab8e288f..582dcaac2c 100644 --- a/src/nvim/testdir/test_excmd.vim +++ b/src/nvim/testdir/test_excmd.vim @@ -481,8 +481,8 @@ func Test_redir_cmd() call assert_fails('redir abc', 'E475:') call assert_fails('redir => 1abc', 'E474:') call assert_fails('redir => a b', 'E488:') - call assert_fails('redir => abc[1]', 'E475:') - let b=0zFF + call assert_fails('redir => abc[1]', 'E121:') + let b = 0zFF call assert_fails('redir =>> b', 'E734:') unlet b -- cgit From df71537a12e454075e02824bb8f570e1e838ee64 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 6 Nov 2022 22:15:33 +0800 Subject: vim-patch:8.2.2570: tests fail when run as root Problem: Tests fail when run as root. Solution: Add a comment mentioning the expected failure. (issue vim/vim#7919) https://github.com/vim/vim/commit/f9a65505d1d93f3e67e5b8646bde3bbc44c70f7d Co-authored-by: Bram Moolenaar --- src/nvim/testdir/test_excmd.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/testdir/test_excmd.vim') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim index 582dcaac2c..91fdb23a63 100644 --- a/src/nvim/testdir/test_excmd.vim +++ b/src/nvim/testdir/test_excmd.vim @@ -476,6 +476,7 @@ func Test_winsize_cmd() endfunc " Test for the :redir command +" NOTE: if you run tests as root this will fail. Don't run tests as root! func Test_redir_cmd() call assert_fails('redir @@', 'E475:') call assert_fails('redir abc', 'E475:') -- cgit From fbe2761b20afaf25a02c06decaf543d211e997f0 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 6 Nov 2022 22:15:59 +0800 Subject: vim-patch:8.2.2623: some tests fail when run as root Problem: Some tests fail when run as root. Solution: Use CheckNotRoot. https://github.com/vim/vim/commit/17709e280ac5ba234b04641cde88d38e3522cedf Co-authored-by: Bram Moolenaar --- src/nvim/testdir/test_excmd.vim | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/nvim/testdir/test_excmd.vim') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim index 91fdb23a63..0e8af08b4b 100644 --- a/src/nvim/testdir/test_excmd.vim +++ b/src/nvim/testdir/test_excmd.vim @@ -493,13 +493,6 @@ func Test_redir_cmd() call assert_fails('redir > Xdir', 'E17:') call delete('Xdir', 'd') endif - if !has('bsd') - " Redirecting to a read-only file - call writefile([], 'Xfile') - call setfperm('Xfile', 'r--r--r--') - call assert_fails('redir! > Xfile', 'E190:') - call delete('Xfile') - endif " Test for redirecting to a register redir @q> | echon 'clean ' | redir END @@ -512,6 +505,17 @@ func Test_redir_cmd() call assert_equal('blue sky', color) endfunc +func Test_redir_cmd_readonly() + CheckNotRoot + CheckNotBSD + + " Redirecting to a read-only file + call writefile([], 'Xfile') + call setfperm('Xfile', 'r--r--r--') + call assert_fails('redir! > Xfile', 'E190:') + call delete('Xfile') +endfunc + " Test for the :filetype command func Test_filetype_cmd() call assert_fails('filetype abc', 'E475:') -- cgit From bfa0be49ed07d1e576c6452bb7e82956df7b19d5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 6 Nov 2022 22:28:39 +0800 Subject: vim-patch:8.2.2627: no need to check for BSD after checking for not root Problem: No need to check for BSD after checking for not root. Solution: Remove CheckNotBSD. (Ozaki Kiichi, closes vim/vim#7989) https://github.com/vim/vim/commit/4355894869355c185e7810e67d52802453576e81 --- src/nvim/testdir/test_excmd.vim | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/testdir/test_excmd.vim') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim index 0e8af08b4b..42b1f8ca48 100644 --- a/src/nvim/testdir/test_excmd.vim +++ b/src/nvim/testdir/test_excmd.vim @@ -507,7 +507,6 @@ endfunc func Test_redir_cmd_readonly() CheckNotRoot - CheckNotBSD " Redirecting to a read-only file call writefile([], 'Xfile') -- cgit From 3f75f25f9c077a284aedab09c5813d887a62f464 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 17 Nov 2022 22:40:10 +0800 Subject: vim-patch:8.2.2945: some buffer related code is not tested Problem: Some buffer related code is not tested. Solution: Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8320) https://github.com/vim/vim/commit/59b262362f26b3aaea1eeb0078adc33eed59863e Co-authored-by: Yegappan Lakshmanan --- src/nvim/testdir/test_excmd.vim | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/nvim/testdir/test_excmd.vim') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim index 42b1f8ca48..44bed890f5 100644 --- a/src/nvim/testdir/test_excmd.vim +++ b/src/nvim/testdir/test_excmd.vim @@ -78,6 +78,14 @@ func Test_file_cmd() call assert_fails('3file', 'E474:') call assert_fails('0,0file', 'E474:') call assert_fails('0file abc', 'E474:') + if !has('win32') + " Change the name of the buffer to the same name + new Xfile1 + file Xfile1 + call assert_equal('Xfile1', @%) + call assert_equal('Xfile1', @#) + bw! + endif endfunc " Test for the :drop command -- cgit