diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-08-09 02:30:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-09 02:30:19 +0200 |
commit | 0b3555b5dda477f647653487d6345ce9cc45304c (patch) | |
tree | 9d3da975ac0f3f0ea4ca3af5e635d6c5322517a6 | |
parent | 72fecad1ffe310b199f4d1640caffdb9fc855537 (diff) | |
parent | f7f79c60bb7d8ef25fd8a183f4a67ff0c95cf9d3 (diff) | |
download | rneovim-0b3555b5dda477f647653487d6345ce9cc45304c.tar.gz rneovim-0b3555b5dda477f647653487d6345ce9cc45304c.tar.bz2 rneovim-0b3555b5dda477f647653487d6345ce9cc45304c.zip |
Merge #8831 from janlazo/vim-8.1.0009
-rw-r--r-- | src/nvim/testdir/test_tabpage.vim | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_tabpage.vim b/src/nvim/testdir/test_tabpage.vim index 180563ebbd..a2eec2cc11 100644 --- a/src/nvim/testdir/test_tabpage.vim +++ b/src/nvim/testdir/test_tabpage.vim @@ -1,5 +1,6 @@ " Tests for tabpage + function Test_tabpage() bw! " Simple test for opening and closing a tab page @@ -106,6 +107,19 @@ function Test_tabpage() call assert_equal(4, tabpagenr()) 7tabmove 5 call assert_equal(5, tabpagenr()) + + " The following are a no-op + norm! 2gt + call assert_equal(2, tabpagenr()) + tabmove 2 + call assert_equal(2, tabpagenr()) + 2tabmove + call assert_equal(2, tabpagenr()) + tabmove 1 + call assert_equal(2, tabpagenr()) + 1tabmove + call assert_equal(2, tabpagenr()) + call assert_fails("99tabmove", 'E16:') call assert_fails("+99tabmove", 'E16:') call assert_fails("-99tabmove", 'E16:') @@ -319,6 +333,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() @@ -493,4 +535,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 |