aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-11-20 22:46:34 -0500
committerGitHub <noreply@github.com>2021-11-20 22:46:34 -0500
commit120a88163078e61b272e9629138642bc5df80e4a (patch)
tree0688ce1bcf39ab6836a49e4a3df4f6fa11214075 /src
parent2bd8f2fb5ee958e210efa27286a8fe0c27b8dbbc (diff)
parent2c431943d663ee9bbd0434a2b34180bcf6a058e9 (diff)
downloadrneovim-120a88163078e61b272e9629138642bc5df80e4a.tar.gz
rneovim-120a88163078e61b272e9629138642bc5df80e4a.tar.bz2
rneovim-120a88163078e61b272e9629138642bc5df80e4a.zip
Merge pull request #14540 from Shougo/fix_vim8.1.1378
[RFC] Improve tests
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_arglist.vim16
-rw-r--r--src/nvim/testdir/test_functions.vim4
-rw-r--r--src/nvim/testdir/test_quickfix.vim3
-rw-r--r--src/nvim/testdir/test_registers.vim5
4 files changed, 20 insertions, 8 deletions
diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim
index 8fd60d6a5a..164149476f 100644
--- a/src/nvim/testdir/test_arglist.vim
+++ b/src/nvim/testdir/test_arglist.vim
@@ -1,5 +1,9 @@
" Test argument list commands
+func Reset_arglist()
+ args a | %argd
+endfunc
+
func Test_argidx()
args a b c
last
@@ -26,6 +30,8 @@ func Test_argidx()
endfunc
func Test_argadd()
+ call Reset_arglist()
+
%argdelete
argadd a b c
call assert_equal(0, argidx())
@@ -115,8 +121,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 +249,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 +276,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()
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..b38a59e98f 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -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)
diff --git a/src/nvim/testdir/test_registers.vim b/src/nvim/testdir/test_registers.vim
index fd8653a2eb..84a5aca3d5 100644
--- a/src/nvim/testdir/test_registers.vim
+++ b/src/nvim/testdir/test_registers.vim
@@ -43,6 +43,10 @@ func Test_yank_shows_register()
endfunc
func Test_display_registers()
+ " Disable clipboard
+ let save_clipboard = get(g:, 'clipboard', {})
+ let g:clipboard = {}
+
e file1
e file2
call setline(1, ['foo', 'bar'])
@@ -78,6 +82,7 @@ func Test_display_registers()
\ . ' c ": ls', a)
bwipe!
+ let g:clipboard = save_clipboard
endfunc
func Test_recording_status_in_ex_line()