aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_tabpage.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-12 08:28:56 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-07-12 14:08:34 +0800
commitd079995fb81bf3d61f7698373442f61476b99fce (patch)
tree27df065f0a9d2b58d90ad17a4cdea751a0b12156 /src/nvim/testdir/test_tabpage.vim
parent6a670a00b3553a3ad87ddc6dfd06725796f58f1e (diff)
downloadrneovim-d079995fb81bf3d61f7698373442f61476b99fce.tar.gz
rneovim-d079995fb81bf3d61f7698373442f61476b99fce.tar.bz2
rneovim-d079995fb81bf3d61f7698373442f61476b99fce.zip
vim-patch:8.2.0270: some code not covered by tests
Problem: Some code not covered by tests. Solution: Add test cases. (Yegappan Lakshmanan, closes vim/vim#5649) https://github.com/vim/vim/commit/bc2b71d44a0b90b6aeb3534a76912fccbe5577df
Diffstat (limited to 'src/nvim/testdir/test_tabpage.vim')
-rw-r--r--src/nvim/testdir/test_tabpage.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_tabpage.vim b/src/nvim/testdir/test_tabpage.vim
index 51ab5c1022..9a115da8d3 100644
--- a/src/nvim/testdir/test_tabpage.vim
+++ b/src/nvim/testdir/test_tabpage.vim
@@ -139,7 +139,11 @@ function Test_tabpage()
call assert_fails("tabmove -99", 'E474:')
call assert_fails("tabmove -3+", 'E474:')
call assert_fails("tabmove $3", 'E474:')
+ call assert_fails("%tabonly", 'E16:')
1tabonly!
+ tabnew
+ call assert_fails("-2tabmove", 'E474:')
+ tabonly!
endfunc
" Test autocommands
@@ -607,6 +611,16 @@ func Test_tabpage_cmdheight()
call delete('XTest_tabpage_cmdheight')
endfunc
+" Test for closing the tab page from a command window
+func Test_tabpage_close_cmdwin()
+ tabnew
+ call feedkeys("q/:tabclose\<CR>\<Esc>", 'xt')
+ call assert_equal(2, tabpagenr('$'))
+ call feedkeys("q/:tabonly\<CR>\<Esc>", 'xt')
+ call assert_equal(2, tabpagenr('$'))
+ tabonly
+endfunc
+
" Return the terminal key code for selecting a tab page from the tabline. This
" sequence contains the following codes: a CSI (0x9b), KS_TABLINE (0xf0),
" KS_FILLER (0x58) and then the tab page number.