From 345789f9ef5d1791b188e8f39214c821ad516109 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 8 Aug 2018 19:34:54 -0400 Subject: vim-patch:8.1.0009: tabpages insufficiently tested Problem: Tabpages insufficiently tested. Solution: Add more test coverage. (Dominique Pelle, closes vim/vim#2934) https://github.com/vim/vim/commit/dbe8869c41a3b3309207a434c17db295d358e873 --- src/nvim/testdir/test_tabpage.vim | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/nvim/testdir/test_tabpage.vim b/src/nvim/testdir/test_tabpage.vim index 180563ebbd..6ca79731bc 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 @@ -319,6 +320,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! \" + call assert_equal(2, tabpagenr()) + exe "norm! \" + call assert_equal(3, tabpagenr()) + + " Check wrapping at last or first page. + exe "norm! \" + call assert_equal(1, tabpagenr()) + exe "norm! \" + call assert_equal(3, tabpagenr()) + + " With a count, and are not symmetrical somehow: + " - {count} goes {count} pages downward (relative count) + " - {count} goes to page number {count} (absolute count) + exe "norm! 2\" + call assert_equal(1, tabpagenr()) + exe "norm! 2\" + call assert_equal(2, tabpagenr()) + + 1tabonly! +endfunc + " Test for [count] of tabclose function Test_tabpage_with_tabclose() @@ -493,4 +522,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 -- cgit From f7f79c60bb7d8ef25fd8a183f4a67ff0c95cf9d3 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 8 Aug 2018 19:35:48 -0400 Subject: vim-patch:8.1.0241: effect of ":tabmove N" is not clear Problem: Effect of ":tabmove N" is not clear. Solution: Add a test that shows the behavior. (Christian Brabandt, closes vim/vim#3288) https://github.com/vim/vim/commit/7cc596547a582e7bc18d91312eb674906ebdc5c2 --- src/nvim/testdir/test_tabpage.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/nvim/testdir/test_tabpage.vim b/src/nvim/testdir/test_tabpage.vim index 6ca79731bc..a2eec2cc11 100644 --- a/src/nvim/testdir/test_tabpage.vim +++ b/src/nvim/testdir/test_tabpage.vim @@ -107,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:') -- cgit