From 133d79a3584edfd1fa546ebe823580e3caac6c87 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Wed, 12 May 2021 14:19:43 +0900 Subject: vim-patch:8.2.3616: arglist test does not clear the argument list consistently Problem: Arglist test does not clear the argument list consistently. Solution: Call Reset_arglist(). (Shougo Matsushita, closes vim/vim#9154) https://github.com/vim/vim/commit/3cad47038547e694cfa26ba39c399f610d2054bd --- src/nvim/testdir/test_arglist.vim | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim index 8fd60d6a5a..9f1e6ef044 100644 --- a/src/nvim/testdir/test_arglist.vim +++ b/src/nvim/testdir/test_arglist.vim @@ -1,5 +1,10 @@ " Test argument list commands +func Reset_arglist() + cd + args a | %argd +endfunc + func Test_argidx() args a b c last @@ -26,6 +31,8 @@ func Test_argidx() endfunc func Test_argadd() + call Reset_arglist() + %argdelete argadd a b c call assert_equal(0, argidx()) @@ -115,8 +122,7 @@ endfunc " Test for [count]argument and [count]argdelete commands " Ported from the test_argument_count.in test script func Test_argument() - " Clean the argument list - arga a | %argd + call Reset_arglist() let save_hidden = &hidden set hidden @@ -244,8 +250,7 @@ endfunc " Test for 0argadd and 0argedit " Ported from the test_argument_0count.in test script func Test_zero_argadd() - " Clean the argument list - arga a | %argd + call Reset_arglist() arga a b c d 2argu @@ -272,10 +277,6 @@ func Test_zero_argadd() call assert_equal('file with spaces', expand('%')) endfunc -func Reset_arglist() - args a | %argd -endfunc - " Test for argc() func Test_argc() call Reset_arglist() @@ -408,6 +409,7 @@ endfunc " Test for the :argdelete command func Test_argdelete() call Reset_arglist() + args aa a aaa b bb argdelete a* call assert_equal(['b', 'bb'], argv()) -- cgit From 4cb8a399c7a6888cfc2dedb08f3a539d5af424e2 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Fri, 14 May 2021 21:54:22 +0900 Subject: fix: add cd for local execution --- src/nvim/testdir/test_command_count.vim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/nvim/testdir/test_command_count.vim b/src/nvim/testdir/test_command_count.vim index c7dddf4164..6251de1ec5 100644 --- a/src/nvim/testdir/test_command_count.vim +++ b/src/nvim/testdir/test_command_count.vim @@ -103,6 +103,8 @@ endfunc func Test_command_count_2() silent! %argd + cd + arga a b c d call assert_fails('5argu', 'E16:') -- cgit From 77c2edcacb747952d43eb50a12e34040d7b61d42 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Fri, 14 May 2021 21:54:52 +0900 Subject: fix: remove previous executed directories to execute tests locally --- src/nvim/testdir/test_functions.vim | 4 ++++ src/nvim/testdir/test_quickfix.vim | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index d10fad690c..4a2ade5afa 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1592,6 +1592,10 @@ func Test_bufadd_bufload() endfunc func Test_readdir() + if isdirectory('Xdir') + call delete('Xdir', 'rf') + endif + call mkdir('Xdir') call writefile([], 'Xdir/foo.txt') call writefile([], 'Xdir/bar.txt') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 8c6ce63ade..1427d32c34 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -1080,9 +1080,9 @@ endfunc func Test_efm_dirstack() " Create the directory stack and files call mkdir('dir1') - call mkdir('dir1/a') - call mkdir('dir1/a/b') - call mkdir('dir1/c') + call mkdir('dir1/a', 'p') + call mkdir('dir1/a/b', 'p') + call mkdir('dir1/c', 'p') call mkdir('dir2') let lines =<< trim [DATA] @@ -3653,6 +3653,9 @@ func Xqftick_tests(cchar) \ {'filename' : 'F7', 'lnum' : 11, 'text' : 'L11'}], 'r') call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick) + if isdirectory("Xone") + call delete("Xone", 'rf') + endif call writefile(["F8:80:L80", "F8:81:L81"], "Xone") Xfile Xone call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick) -- cgit From dd63d9393192d96ac7fbd1fd62c5ffb776b228e2 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Fri, 14 May 2021 21:55:14 +0900 Subject: fix: disable clipboard when test registers --- src/nvim/testdir/test_registers.vim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/nvim/testdir/test_registers.vim b/src/nvim/testdir/test_registers.vim index fd8653a2eb..5ecc8b59e7 100644 --- a/src/nvim/testdir/test_registers.vim +++ b/src/nvim/testdir/test_registers.vim @@ -43,6 +43,9 @@ func Test_yank_shows_register() endfunc func Test_display_registers() + " Disable clipboard + let g:clipboard = {} + e file1 e file2 call setline(1, ['foo', 'bar']) -- cgit From a11cec08e5a5bfc2bd9f6f3d72d3ef6225c32efc Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sun, 23 May 2021 14:20:59 +0900 Subject: fix: for reviews --- src/nvim/testdir/test_arglist.vim | 1 - src/nvim/testdir/test_command_count.vim | 1 - src/nvim/testdir/test_quickfix.vim | 6 +++--- 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim index 9f1e6ef044..7215677e2d 100644 --- a/src/nvim/testdir/test_arglist.vim +++ b/src/nvim/testdir/test_arglist.vim @@ -1,7 +1,6 @@ " Test argument list commands func Reset_arglist() - cd args a | %argd endfunc diff --git a/src/nvim/testdir/test_command_count.vim b/src/nvim/testdir/test_command_count.vim index 6251de1ec5..2990c92711 100644 --- a/src/nvim/testdir/test_command_count.vim +++ b/src/nvim/testdir/test_command_count.vim @@ -103,7 +103,6 @@ endfunc func Test_command_count_2() silent! %argd - cd arga a b c d call assert_fails('5argu', 'E16:') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 1427d32c34..b38a59e98f 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -1080,9 +1080,9 @@ endfunc func Test_efm_dirstack() " Create the directory stack and files call mkdir('dir1') - call mkdir('dir1/a', 'p') - call mkdir('dir1/a/b', 'p') - call mkdir('dir1/c', 'p') + call mkdir('dir1/a') + call mkdir('dir1/a/b') + call mkdir('dir1/c') call mkdir('dir2') let lines =<< trim [DATA] -- cgit From 18d7ec36f3a664174b46845d01bccab4eba6fc5b Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sun, 23 May 2021 14:25:06 +0900 Subject: fix: remove unnecessary changes --- src/nvim/testdir/test_arglist.vim | 1 - src/nvim/testdir/test_command_count.vim | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim index 7215677e2d..164149476f 100644 --- a/src/nvim/testdir/test_arglist.vim +++ b/src/nvim/testdir/test_arglist.vim @@ -408,7 +408,6 @@ endfunc " Test for the :argdelete command func Test_argdelete() call Reset_arglist() - args aa a aaa b bb argdelete a* call assert_equal(['b', 'bb'], argv()) diff --git a/src/nvim/testdir/test_command_count.vim b/src/nvim/testdir/test_command_count.vim index 2990c92711..c7dddf4164 100644 --- a/src/nvim/testdir/test_command_count.vim +++ b/src/nvim/testdir/test_command_count.vim @@ -103,7 +103,6 @@ endfunc func Test_command_count_2() silent! %argd - arga a b c d call assert_fails('5argu', 'E16:') -- cgit From c11cf6b415c7dfead5548ea64d30089f6a60cf63 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Wed, 26 May 2021 09:59:58 +0900 Subject: test: save clipboard --- src/nvim/testdir/test_registers.vim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/nvim/testdir/test_registers.vim b/src/nvim/testdir/test_registers.vim index 5ecc8b59e7..de8cf4949b 100644 --- a/src/nvim/testdir/test_registers.vim +++ b/src/nvim/testdir/test_registers.vim @@ -44,6 +44,7 @@ endfunc func Test_display_registers() " Disable clipboard + let save_clipboard = g:clipboard let g:clipboard = {} e file1 @@ -81,6 +82,7 @@ func Test_display_registers() \ . ' c ": ls', a) bwipe! + let g:clipboard = save_clipboard endfunc func Test_recording_status_in_ex_line() -- cgit From e9819ca709c43de7622dbf98c564ab2a9fe4a50c Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sun, 13 Jun 2021 11:35:05 +0900 Subject: fix: error --- src/nvim/testdir/test_registers.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testdir/test_registers.vim b/src/nvim/testdir/test_registers.vim index de8cf4949b..84a5aca3d5 100644 --- a/src/nvim/testdir/test_registers.vim +++ b/src/nvim/testdir/test_registers.vim @@ -44,7 +44,7 @@ endfunc func Test_display_registers() " Disable clipboard - let save_clipboard = g:clipboard + let save_clipboard = get(g:, 'clipboard', {}) let g:clipboard = {} e file1 -- cgit