diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-05-20 14:57:22 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-05-20 14:57:22 +0200 |
commit | dbe8869c41a3b3309207a434c17db295d358e873 (patch) | |
tree | eced686dddb14dc056ba28c5d75e44b2d9151469 /src/testdir/test_tabpage.vim | |
parent | 42ab17b8e32352210c4e273a4a4161a287d2c159 (diff) | |
download | vim-git-dbe8869c41a3b3309207a434c17db295d358e873.tar.gz |
patch 8.1.0009: tabpages insufficiently testedv8.1.0009
Problem: Tabpages insufficiently tested.
Solution: Add more test coverage. (Dominique Pelle, closes #2934)
Diffstat (limited to 'src/testdir/test_tabpage.vim')
-rw-r--r-- | src/testdir/test_tabpage.vim | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim index fae95ab98..f4fbf28d1 100644 --- a/src/testdir/test_tabpage.vim +++ b/src/testdir/test_tabpage.vim @@ -1,5 +1,6 @@ " Tests for tabpage + function Test_tabpage() bw! " Simple test for opening and closing a tab page @@ -317,6 +318,34 @@ function s:reconstruct_tabpage_for_test(nr) endfor endfunc +func Test_tabpage_ctrl_pgup_pgdown() + enew! + tabnew tab1 + tabnew tab2 + + call assert_equal(3, tabpagenr()) + exe "norm! \<C-PageUp>" + call assert_equal(2, tabpagenr()) + exe "norm! \<C-PageDown>" + call assert_equal(3, tabpagenr()) + + " Check wrapping at last or first page. + exe "norm! \<C-PageDown>" + call assert_equal(1, tabpagenr()) + exe "norm! \<C-PageUp>" + call assert_equal(3, tabpagenr()) + + " With a count, <C-PageUp> and <C-PageDown> are not symmetrical somehow: + " - {count}<C-PageUp> goes {count} pages downward (relative count) + " - {count}<C-PageDown> goes to page number {count} (absolute count) + exe "norm! 2\<C-PageUp>" + call assert_equal(1, tabpagenr()) + exe "norm! 2\<C-PageDown>" + call assert_equal(2, tabpagenr()) + + 1tabonly! +endfunc + " Test for [count] of tabclose function Test_tabpage_with_tabclose() @@ -491,4 +520,18 @@ func Test_close_on_quitpre() buf Xtest endfunc +func Test_tabs() + enew! + tabnew tab1 + norm ixxx + let a=split(execute(':tabs'), "\n") + call assert_equal(['Tab page 1', + \ ' [No Name]', + \ 'Tab page 2', + \ '> + tab1'], a) + + 1tabonly! + bw! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |