]> granicus.if.org Git - vim/commitdiff
patch 8.1.0009: tabpages insufficiently tested v8.1.0009
authorBram Moolenaar <Bram@vim.org>
Sun, 20 May 2018 12:57:22 +0000 (14:57 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 20 May 2018 12:57:22 +0000 (14:57 +0200)
Problem:    Tabpages insufficiently tested.
Solution:   Add more test coverage. (Dominique Pelle, closes #2934)

src/testdir/test_tabpage.vim
src/version.c

index fae95ab98f879309e2cac01e4594bc2a9141e8d8..f4fbf28d19a92f67f17e9fef69c40d93711e1382 100644 (file)
@@ -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
index f2fa2a701aa3251ada6af24ea1450e76056f7772..1eb470b55951b85e9fd94993931354785fbdc689 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    9,
 /**/
     8,
 /**/