aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-05 23:11:36 +0800
committerGitHub <noreply@github.com>2022-10-05 23:11:36 +0800
commit28e228d60dc1120a56be8757ddf7bc0deedf71da (patch)
tree7abf82147c9aa7e00680282b7b2da9752c9668d1 /src/nvim/testdir
parent1f2ded459a6f26635bf013da4100b3dedb777f73 (diff)
parent4ebcc6f8225acd6d0bc1075bf769148e2f369bcc (diff)
downloadrneovim-28e228d60dc1120a56be8757ddf7bc0deedf71da.tar.gz
rneovim-28e228d60dc1120a56be8757ddf7bc0deedf71da.tar.bz2
rneovim-28e228d60dc1120a56be8757ddf7bc0deedf71da.zip
Merge pull request #20497 from zeertzjq/vim-8.2.2413
vim-patch:8.2.{2413,2421,2463,3884,3885,3886},9.0.0388: arglist patches
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_arglist.vim37
-rw-r--r--src/nvim/testdir/test_autocmd.vim16
2 files changed, 44 insertions, 9 deletions
diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim
index 521c3fcd57..c01ae87fd8 100644
--- a/src/nvim/testdir/test_arglist.vim
+++ b/src/nvim/testdir/test_arglist.vim
@@ -509,18 +509,14 @@ func Test_arglist_autocmd()
new
" redefine arglist; go to Xxx1
next! Xxx1 Xxx2 Xxx3
- " open window for all args; Reading Xxx2 will change the arglist and the
- " third window will get Xxx1:
- " win 1: Xxx1
- " win 2: Xxx2
- " win 3: Xxx1
- all
+ " open window for all args; Reading Xxx2 will try to change the arglist and
+ " that will fail
+ call assert_fails("all", "E1156:")
call assert_equal('test file Xxx1', getline(1))
wincmd w
- wincmd w
- call assert_equal('test file Xxx1', getline(1))
- rewind
call assert_equal('test file Xxx2', getline(1))
+ wincmd w
+ call assert_equal('test file Xxx3', getline(1))
autocmd! BufReadPost Xxx2
enew! | only
@@ -591,4 +587,27 @@ func Test_quit_with_arglist()
call delete('.c.swp')
endfunc
+" Test for ":all" not working when in the cmdline window
+func Test_all_not_allowed_from_cmdwin()
+ au BufEnter * all
+ next x
+ " Use try/catch here, somehow assert_fails() doesn't work on MS-Windows
+ " console.
+ let caught = 'no'
+ try
+ exe ":norm! 7q?apat\<CR>"
+ catch /E11:/
+ let caught = 'yes'
+ endtry
+ call assert_equal('yes', caught)
+ au! BufEnter
+endfunc
+
+func Test_clear_arglist_in_all()
+ n 0 00 000 0000 00000 000000
+ au WinNew 0 n 0
+ call assert_fails("all", "E1156")
+ au! *
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index d766256d4b..025bda4515 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -148,6 +148,12 @@ func Test_autocmd_bufunload_with_tabnext()
quit
endfunc
+func Test_argdelete_in_next()
+ au BufNew,BufEnter,BufLeave,BufWinEnter * argdel
+ call assert_fails('next a b', 'E1156:')
+ au! BufNew,BufEnter,BufLeave,BufWinEnter *
+endfunc
+
func Test_autocmd_bufwinleave_with_tabfirst()
tabedit
augroup sample
@@ -2048,6 +2054,7 @@ endfunc
func Test_autocommand_all_events()
call assert_fails('au * * bwipe', 'E1155:')
call assert_fails('au * x bwipe', 'E1155:')
+ call assert_fails('au! * x bwipe', 'E1155:')
endfunc
func Test_autocmd_user()
@@ -3004,6 +3011,15 @@ func Test_Visual_doautoall_redraw()
%bwipe!
endfunc
+" This was using freed memory.
+func Test_BufNew_arglocal()
+ arglocal
+ au BufNew * arglocal
+ call assert_fails('drop xx', 'E1156:')
+
+ au! BufNew
+endfunc
+
func Test_autocmd_closes_window()
au BufNew,BufWinLeave * e %e
file yyy